Skip to content

Commit

Permalink
Test win state with full board
Browse files Browse the repository at this point in the history
  • Loading branch information
mnpw committed Jun 30, 2022
1 parent f66c864 commit 30a8222
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,20 @@ mod tests {
assert_eq!(state, GameState::Won);
}

#[test]
fn won_full_board() {
let state = indoc! {"
2,4,2,4
4,2,8,2
2,4,2,4
4,2,4,2
"};

let mut game = Game::from(4, 8, state);
let state = game.check().unwrap();
assert_eq!(state, GameState::Won);
}

#[test]
fn next_move_win_top_left() {
let state = indoc! {"
Expand Down

0 comments on commit 30a8222

Please sign in to comment.