Skip to content

Commit 321247d

Browse files
committed
Share testing utilities with non-btree test cases
1 parent f6cbc92 commit 321247d

File tree

8 files changed

+7
-8
lines changed

8 files changed

+7
-8
lines changed

library/alloc/src/collections/btree/map/tests.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
use super::super::testing::crash_test::{CrashTestDummy, Panic};
2-
use super::super::testing::ord_chaos::{Cyclic3, Governed, Governor};
3-
use super::super::testing::rng::DeterministicRng;
41
use super::Entry::{Occupied, Vacant};
52
use super::*;
63
use crate::boxed::Box;
74
use crate::fmt::Debug;
85
use crate::rc::Rc;
96
use crate::string::{String, ToString};
7+
use crate::testing::crash_test::{CrashTestDummy, Panic};
8+
use crate::testing::ord_chaos::{Cyclic3, Governed, Governor};
9+
use crate::testing::rng::DeterministicRng;
1010
use crate::vec::Vec;
1111
use std::cmp::Ordering;
1212
use std::convert::TryFrom;

library/alloc/src/collections/btree/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,3 @@ trait Recover<Q: ?Sized> {
2020
fn take(&mut self, key: &Q) -> Option<Self::Key>;
2121
fn replace(&mut self, key: Self::Key) -> Option<Self::Key>;
2222
}
23-
24-
#[cfg(test)]
25-
mod testing;

library/alloc/src/collections/btree/set/tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use super::super::testing::crash_test::{CrashTestDummy, Panic};
2-
use super::super::testing::rng::DeterministicRng;
31
use super::*;
2+
use crate::testing::crash_test::{CrashTestDummy, Panic};
3+
use crate::testing::rng::DeterministicRng;
44
use crate::vec::Vec;
55
use std::cmp::Ordering;
66
use std::hash::{Hash, Hasher};

library/alloc/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@
188188
extern crate std;
189189
#[cfg(test)]
190190
extern crate test;
191+
#[cfg(test)]
192+
mod testing;
191193

192194
// Module with internal macros used by other modules (needs to be included before other modules).
193195
#[macro_use]

0 commit comments

Comments
 (0)