Skip to content

Commit ddfc65d

Browse files
authored
Rollup merge of rust-lang#94126 - ssomers:alloc_prep_1, r=Mark-Simulacrum
Classify BinaryHeap & LinkedList unit tests as such All but one of these so-called integration test case are unit tests, just like btree's were (rust-lang#75531). In addition, reunite the unit tests of linked_list that were split off during rust-lang#23104 because they needed to remain unit tests (they were later moved to the separate file they are in during rust-lang#63207). The two sets could remain separate files, but I opted to merge them back together, more or less in the order they used to be, apart from one duplicate name `test_split_off` and one duplicate tiny function `list_from`.
2 parents 4c5efea + a3a5d83 commit ddfc65d

File tree

5 files changed

+692
-694
lines changed

5 files changed

+692
-694
lines changed

library/alloc/src/collections/binary_heap.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ use crate::vec::{self, AsVecIntoIter, Vec};
155155

156156
use super::SpecExtend;
157157

158+
#[cfg(test)]
159+
mod tests;
160+
158161
/// A priority queue implemented with a binary heap.
159162
///
160163
/// This will be a max-heap.

library/alloc/tests/binary_heap.rs renamed to library/alloc/src/collections/binary_heap/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use std::collections::binary_heap::{Drain, PeekMut};
2-
use std::collections::BinaryHeap;
1+
use super::*;
2+
use crate::boxed::Box;
33
use std::iter::TrustedLen;
44
use std::panic::{catch_unwind, AssertUnwindSafe};
55
use std::sync::atomic::{AtomicU32, Ordering};

0 commit comments

Comments
 (0)