X-Git-Url: http://git.scottworley.com/pluta-lesnura/blobdiff_plain/b6963095666ca65bf3c1b67cdfc7f2695fcc99ee..58616aebd3c387d97b4cc8c319deb8ceb5af745b:/src/lib.rs?ds=sidebyside diff --git a/src/lib.rs b/src/lib.rs index c73c146..59a47a9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -490,8 +490,15 @@ mod tests { #[test] fn test_game() { - let mut game = Game::default(); - game.add_player(); - assert!(play(game, vec![Player(Box::new(random_player))]).is_ok()); + for num_players in 1..10 { + let players: Vec<_> = std::iter::from_fn(|| Some(Player(Box::new(random_player)))) + .take(num_players) + .collect(); + let mut game = Game::default(); + for _ in 0..num_players { + game.add_player(); + } + assert!(play(game, players).is_ok()); + } } }