Skip to content

Commit

Permalink
chore: update to quickcheck 1
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto authored and seanmonstar committed Feb 15, 2024
1 parent aed8be3 commit fd2ad94
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ itoa = "1"

[dev-dependencies]
indexmap = "<=1.8"
quickcheck = "0.9.0"
rand = "0.7.0"
quickcheck = "1"
rand = "0.8.0"
seahash = "3.0.5"
serde = "1.0"
serde_json = "1.0"
Expand Down
16 changes: 8 additions & 8 deletions tests/header_map_fuzz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ impl Fuzz {

let mut steps = vec![];
let mut expect = AltMap::default();
let num = rng.gen_range(5, 500);
let num = rng.gen_range(5..500);

let weight = Weight {
insert: rng.gen_range(1, 10),
remove: rng.gen_range(1, 10),
append: rng.gen_range(1, 10),
insert: rng.gen_range(1..10),
remove: rng.gen_range(1..10),
append: rng.gen_range(1..10),
};

while steps.len() < num {
Expand Down Expand Up @@ -111,8 +111,8 @@ impl Fuzz {
}

impl Arbitrary for Fuzz {
fn arbitrary<G: Gen>(g: &mut G) -> Self {
Fuzz::new(Rng::gen(g))
fn arbitrary(_: &mut Gen) -> Self {
Self::new(rand::thread_rng().gen())
}
}

Expand All @@ -130,7 +130,7 @@ impl AltMap {
fn gen_action(&mut self, weight: &Weight, rng: &mut StdRng) -> Action {
let sum = weight.insert + weight.remove + weight.append;

let mut num = rng.gen_range(0, sum);
let mut num = rng.gen_range(0..sum);

if num < weight.insert {
return self.gen_insert(rng);
Expand Down Expand Up @@ -213,7 +213,7 @@ impl AltMap {
if self.map.is_empty() {
None
} else {
let n = rng.gen_range(0, self.map.len());
let n = rng.gen_range(0..self.map.len());
self.map.keys().nth(n).map(Clone::clone)
}
}
Expand Down

0 comments on commit fd2ad94

Please sign in to comment.