]> git.scottworley.com Git - pluta-lesnura/blobdiff - src/lib.rs
Enable clap derive
[pluta-lesnura] / src / lib.rs
index c73c146dceef08cb2142ec86418cd76f5d847980..59a47a9d0eb9056c49bb2ae83a97b282c326f12f 100644 (file)
@@ -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());
+        }
     }
 }