Skip to content

Commit

Permalink
Update rand
Browse files Browse the repository at this point in the history
  • Loading branch information
jbhannah committed Jul 8, 2024
1 parent ff4ea26 commit 54d4d52
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 17 deletions.
35 changes: 28 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ assert_cmd = "2.0.4"
atty = "0.2.14"
clap = { version = "4.0.14", features = ["derive"] }
lazy_static = "1.4.0"
rand = "0.8.5"
rand = "0.9.0-alpha.1"

[profile.release]
codegen-units = 1
Expand Down
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ mod test {
let mut rng = rng_from_seed(POKEMON_COUNT);

assert_eq!(
"Clobbopus Mudbray Graveler Frosmoth".to_string(),
"Makuhita Milotic Shiftry Charmander".to_string(),
generate(None, 4, " ", &mut rng)
);
}
Expand All @@ -85,7 +85,7 @@ mod test {
let mut rng = rng_from_seed(POKEMON_COUNT);

assert_eq!(
"Clobbopus Mudbray Graveler Frosmoth Dustox".to_string(),
"Makuhita Milotic Shiftry Charmander Swadloon".to_string(),
generate(Some(40), 4, " ", &mut rng)
);
}
Expand All @@ -97,7 +97,7 @@ mod test {
let mut rng = rng_from_seed(POKEMON_COUNT);

assert_eq!(
"Clobbopus-Mudbray-Graveler-Frosmoth".to_string(),
"Makuhita-Milotic-Shiftry-Charmander".to_string(),
generate(None, 4, "-", &mut rng)
);
}
Expand All @@ -109,7 +109,7 @@ mod test {
let mut rng = rng_from_seed(POKEMON_COUNT);

assert_eq!(
"Clobbopus6Mudbray2Graveler7Frosmoth".to_string(),
"Makuhita6Milotic2Shiftry7Charmander".to_string(),
generate(None, 4, "digit", &mut rng)
);
}
Expand All @@ -121,7 +121,7 @@ mod test {
let mut rng = rng_from_seed(POKEMON_COUNT);

assert_eq!(
"Clobbopus]Mudbray!Graveler-Frosmoth".to_string(),
"Makuhita]Milotic!Shiftry-Charmander".to_string(),
generate(None, 4, "special", &mut rng)
);
}
Expand Down
8 changes: 4 additions & 4 deletions src/pokemon/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ mod test {
let picked = pokemon.length(40, 1);

assert_eq!(
vec!["Clobbopus", "Mudbray", "Graveler", "Frosmoth", "Dustox"],
vec!["Makuhita", "Milotic", "Shiftry", "Charmander", "Swadloon"],
picked
);
assert!(picked.join(" ").len() > 40);
Expand All @@ -120,7 +120,7 @@ mod test {
let mut pokemon = from_seed(POKEMON_COUNT);

assert_eq!(
vec!["Clobbopus", "Mudbray", "Graveler", "Frosmoth"],
vec!["Makuhita", "Milotic", "Shiftry", "Charmander"],
pokemon.pick(4)
);
}
Expand All @@ -131,8 +131,8 @@ mod test {
fn test_pick_pick() {
let mut pokemon = from_seed(POKEMON_COUNT);

assert_eq!(vec!["Clobbopus", "Mudbray", "Graveler"], pokemon.pick(3));
assert_eq!(vec!["Frosmoth", "Dustox"], pokemon.pick(2));
assert_eq!(vec!["Makuhita", "Milotic", "Shiftry"], pokemon.pick(3));
assert_eq!(vec!["Charmander", "Swadloon"], pokemon.pick(2));
}

/// Ensure that all Pokémon names are loaded.
Expand Down

0 comments on commit 54d4d52

Please sign in to comment.