Skip to content

Commit 54039ca

Browse files
committed
try to really fix tests on macOS
1 parent 341798f commit 54039ca

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

test-cargo-miri/tests/test.rs

+10-7
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,18 @@ fn fixed_rng() {
2020
}
2121

2222
#[test]
23-
#[cfg(not(target_os="macos"))] // FIXME entropy does not work on macOS
2423
fn entropy_rng() {
25-
// Use this opportunity to test querying the RNG (needs an external crate, hence tested here and not in the compiletest suite)
26-
let mut rng = SmallRng::from_entropy();
27-
let _val = rng.gen::<i32>();
24+
#[cfg(not(target_os="macos"))] // FIXME entropy does not work on macOS
25+
// (Not disabling the entire test as that would change the output.)
26+
{
27+
// Use this opportunity to test querying the RNG (needs an external crate, hence tested here and not in the compiletest suite)
28+
let mut rng = SmallRng::from_entropy();
29+
let _val = rng.gen::<i32>();
2830

29-
// Also try per-thread RNG.
30-
let mut rng = rand::thread_rng();
31-
let _val = rng.gen::<i32>();
31+
// Also try per-thread RNG.
32+
let mut rng = rand::thread_rng();
33+
let _val = rng.gen::<i32>();
34+
}
3235
}
3336

3437
// A test that won't work on miri

0 commit comments

Comments
 (0)