try to really fix tests on macOS
This commit is contained in:
parent
341798f09d
commit
54039cafa8
1 changed files with 10 additions and 7 deletions
|
|
@ -20,15 +20,18 @@ fn fixed_rng() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(target_os="macos"))] // FIXME entropy does not work on macOS
|
||||
fn entropy_rng() {
|
||||
// Use this opportunity to test querying the RNG (needs an external crate, hence tested here and not in the compiletest suite)
|
||||
let mut rng = SmallRng::from_entropy();
|
||||
let _val = rng.gen::<i32>();
|
||||
#[cfg(not(target_os="macos"))] // FIXME entropy does not work on macOS
|
||||
// (Not disabling the entire test as that would change the output.)
|
||||
{
|
||||
// Use this opportunity to test querying the RNG (needs an external crate, hence tested here and not in the compiletest suite)
|
||||
let mut rng = SmallRng::from_entropy();
|
||||
let _val = rng.gen::<i32>();
|
||||
|
||||
// Also try per-thread RNG.
|
||||
let mut rng = rand::thread_rng();
|
||||
let _val = rng.gen::<i32>();
|
||||
// Also try per-thread RNG.
|
||||
let mut rng = rand::thread_rng();
|
||||
let _val = rng.gen::<i32>();
|
||||
}
|
||||
}
|
||||
|
||||
// A test that won't work on miri
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue