]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/collections/hash/map/tests.rs
Update rand in the stdlib tests, and remove the getrandom feature from it
[rust.git] / library / std / src / collections / hash / map / tests.rs
index 65634f2063f36da25633548a6be59ce94a7dda21..6b89518e2e26cd69bdb606b44dfc38815c09cab3 100644 (file)
@@ -3,7 +3,8 @@
 use super::RandomState;
 use crate::assert_matches::assert_matches;
 use crate::cell::RefCell;
-use rand::{thread_rng, Rng};
+use crate::test_helpers::test_rng;
+use rand::Rng;
 use realstd::collections::TryReserveErrorKind::*;
 
 // https://github.com/rust-lang/rust/issues/62301
@@ -710,16 +711,16 @@ fn check(m: &HashMap<i32, ()>) {
     }
 
     let mut m = HashMap::new();
-    let mut rng = thread_rng();
+    let mut rng = test_rng();
 
     // Populate the map with some items.
     for _ in 0..50 {
-        let x = rng.gen_range(-1010);
+        let x = rng.gen_range(-10..10);
         m.insert(x, ());
     }
 
     for _ in 0..1000 {
-        let x = rng.gen_range(-1010);
+        let x = rng.gen_range(-10..10);
         match m.entry(x) {
             Vacant(_) => {}
             Occupied(e) => {