1 use rand::{FromEntropy, Rng, rngs::SmallRng};
3 // Having more than 1 test does seem to make a difference
4 // (i.e., this calls ptr::swap which having just one test does not).
10 // Having more than 1 test does seem to make a difference
11 // (i.e., this calls ptr::swap which having just one test does not).
14 // Use this opportunity to test querying the RNG (needs an external crate, hence tested here and not in the compiletest suite)
15 let mut rng = SmallRng::from_entropy();
16 let _val = rng.gen::<i32>();
18 // Also try per-thread RNG.
19 let mut rng = rand::thread_rng();
20 let _val = rng.gen::<i32>();
23 // A test that won't work on miri
26 fn does_not_work_on_miri() {
28 assert!(&x as *const _ as usize % 4 < 4);