Skip to content

Merge pull request #180 from joshuafolkken/168-fix-can-sometimes-pres… #29

Merge pull request #180 from joshuafolkken/168-fix-can-sometimes-pres…

Merge pull request #180 from joshuafolkken/168-fix-can-sometimes-pres… #29

GitHub Actions / test_report.xml succeeded Sep 28, 2024 in 1s

151 passed, 0 failed and 0 skipped

Tests passed successfully

✅ ./reports/report_1/results.xml

151 tests were completed in 4s with 151 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
base_test 0ms
board_position_test 25✅ 621ms
board_test 4✅ 85ms
cell_status_collection_test 29✅ 598ms
cell_status_test 42✅ 945ms
game_player_test 16✅ 384ms
game_status_test 16✅ 397ms
gameplay_test 7✅ 340ms
init_test 1✅ 49ms
position_history_test 6✅ 139ms
ui_test 5✅ 706ms

✅ board_position_test

✅ test_init
✅ test_init:0 [0, 0, true]
✅ test_init:1 [-1, -1, true]
✅ test_init:2 [-2, -2, false]
✅ test_init:3 [1, 2, true]
✅ test_init:4 [1, 3, false]
✅ test_init:5 [2, 0, true]
✅ test_init:6 [3, 2, false]
✅ test_hash
✅ test_hash:0 [0, 0, hash([0, 0])]
✅ test_hash:1 [-1, -1, hash([-1, -1])]
✅ test_hash:2 [1, 2, hash([1, 2])]
✅ test_to_string
✅ test_to_string:0 [-1, -1, 'BoardPosition(row = -1, col = -1)']
✅ test_to_string:1 [2, 1, 'BoardPosition(row = 2, col = 1)']
✅ test_to_index
✅ test_to_index:0 [-1, -1, -4]
✅ test_to_index:1 [2, 1, 7]
✅ test_is_valid
✅ test_is_valid:0 [-1, -1, false]
✅ test_is_valid:1 [-1, 0, false]
✅ test_is_valid:2 [0, -1, false]
✅ test_is_valid:3 [0, 0, true]
✅ test_is_valid:4 [1, 2, true]
✅ test_is_valid:5 [2, 2, true]

✅ board_test

✅ test_init
✅ test_set_value_and_get_value
✅ test_set_value_and_get_value:0 [0, 1, CellStatus.State.X]
✅ test_set_value_and_get_value:1 [1, 2, CellStatus.State.O]

✅ cell_status_collection_test

✅ test_init
✅ test_append
✅ test_append:0 [CellStatus.State.O, CellStatus.State.O]
✅ test_append:1 [CellStatus.State.X, CellStatus.State.X]
✅ test_get_at
✅ test_is_empty
✅ test_is_empty:0 [[], true]
✅ test_is_empty:1 [[CellStatus.empty], false]
✅ test_are_all_same_and_not_empty
✅ test_are_all_same_and_not_empty:0 [[], false]
✅ test_are_all_same_and_not_empty:1 [[CellStatus.empty, CellStatus.empty, CellStatus.x], false]
✅ test_are_all_same_and_not_empty:2 [[CellStatus.empty, CellStatus.x, CellStatus.x], false]
✅ test_are_all_same_and_not_empty:3 [[CellStatus.x, CellStatus.x, CellStatus.x], true]
✅ test_are_all_same_and_not_empty:4 [[CellStatus.x, CellStatus.x, CellStatus.o], false]
✅ test_are_all_same_and_not_empty:5 [[CellStatus.x, CellStatus.o, CellStatus.o], false]
✅ test_are_all_same_and_not_empty:6 [[CellStatus.o, CellStatus.o, CellStatus.o], true]
✅ test_are_all_same_and_not_empty:7 [[CellStatus.o, CellStatus.x, CellStatus.o], false]
✅ test_are_all_same_and_not_empty:8 [[CellStatus.o, CellStatus.empty, CellStatus.o], false]
✅ test_get_winner
✅ test_get_winner:0 [[], CellStatus.empty]
✅ test_get_winner:1 [[CellStatus.empty, CellStatus.empty, CellStatus.empty], CellStatus.empty]
✅ test_get_winner:2 [[CellStatus.empty, CellStatus.empty, CellStatus.x], CellStatus.empty]
✅ test_get_winner:3 [[CellStatus.empty, CellStatus.x, CellStatus.x], CellStatus.empty]
✅ test_get_winner:4 [[CellStatus.x, CellStatus.x, CellStatus.x], CellStatus.x]
✅ test_get_winner:5 [[CellStatus.x, CellStatus.x, CellStatus.o], CellStatus.empty]
✅ test_get_winner:6 [[CellStatus.x, CellStatus.o, CellStatus.o], CellStatus.empty]
✅ test_get_winner:7 [[CellStatus.o, CellStatus.o, CellStatus.o], CellStatus.o]
✅ test_get_winner:8 [[CellStatus.o, CellStatus.x, CellStatus.o], CellStatus.empty]
✅ test_get_winner:9 [[CellStatus.o, CellStatus.empty, CellStatus.o], CellStatus.empty]

✅ cell_status_test

✅ test_init
✅ test_init:0 [CellStatus.State.EMPTY, true]
✅ test_init:1 [CellStatus.State.X, true]
✅ test_init:2 [CellStatus.State.O, true]
✅ test_init:3 [-1, false]
✅ test_to_string
✅ test_to_string:0 [CellStatus.State.EMPTY, 'EMPTY']
✅ test_to_string:1 [CellStatus.State.X, 'X']
✅ test_to_string:2 [CellStatus.State.O, 'O']
✅ test_is_empty
✅ test_is_empty:0 [CellStatus.State.EMPTY, true]
✅ test_is_empty:1 [CellStatus.State.X, false]
✅ test_is_empty:2 [CellStatus.State.O, false]
✅ test_is_not_empty
✅ test_is_not_empty:0 [CellStatus.State.EMPTY, false]
✅ test_is_not_empty:1 [CellStatus.State.X, true]
✅ test_is_not_empty:2 [CellStatus.State.O, true]
✅ test_is_x
✅ test_is_x:0 [CellStatus.State.EMPTY, false]
✅ test_is_x:1 [CellStatus.State.X, true]
✅ test_is_x:2 [CellStatus.State.O, false]
✅ test_is_o
✅ test_is_o:0 [CellStatus.State.EMPTY, false]
✅ test_is_o:1 [CellStatus.State.X, false]
✅ test_is_o:2 [CellStatus.State.O, true]
✅ test_is_equal
✅ test_is_equal:0 [CellStatus.State.EMPTY, CellStatus.State.EMPTY, true]
✅ test_is_equal:1 [CellStatus.State.X, CellStatus.State.X, true]
✅ test_is_equal:2 [CellStatus.State.O, CellStatus.State.O, true]
✅ test_is_equal:3 [CellStatus.State.EMPTY, CellStatus.State.X, false]
✅ test_is_equal:4 [CellStatus.State.X, CellStatus.State.O, false]
✅ test_is_equal:5 [CellStatus.State.O, CellStatus.State.EMPTY, false]
✅ test_is_equal_and_not_empty
✅ test_is_equal_and_not_empty:0 [CellStatus.State.EMPTY, CellStatus.State.EMPTY, false]
✅ test_is_equal_and_not_empty:1 [CellStatus.State.X, CellStatus.State.X, true]
✅ test_is_equal_and_not_empty:2 [CellStatus.State.O, CellStatus.State.O, true]
✅ test_is_equal_and_not_empty:3 [CellStatus.State.EMPTY, CellStatus.State.X, false]
✅ test_is_equal_and_not_empty:4 [CellStatus.State.X, CellStatus.State.O, false]
✅ test_is_equal_and_not_empty:5 [CellStatus.State.O, CellStatus.State.EMPTY, false]
✅ test_from_game_player
✅ test_from_game_player:0 [GamePlayer.Id.X, true, CellStatus.State.X]
✅ test_from_game_player:1 [GamePlayer.Id.O, true, CellStatus.State.O]

✅ game_player_test

✅ test_init
✅ test_to_string
✅ test_to_string:0 [GamePlayer.Id.X, 'GamePlayer(id = X)']
✅ test_to_string:1 [GamePlayer.Id.O, 'GamePlayer(id = O)']
✅ test_get_value
✅ test_get_value:0 [GamePlayer.Id.X, GamePlayer.Id.X]
✅ test_get_value:1 [GamePlayer.Id.O, GamePlayer.Id.O]
✅ test_is_x
✅ test_is_x:0 [GamePlayer.Id.X, true]
✅ test_is_x:1 [GamePlayer.Id.O, false]
✅ test_is_o
✅ test_is_o:0 [GamePlayer.Id.X, false]
✅ test_is_o:1 [GamePlayer.Id.O, true]
✅ test_next
✅ test_next:0 [GamePlayer.Id.X, GamePlayer.Id.O]
✅ test_next:1 [GamePlayer.Id.O, GamePlayer.Id.X]

✅ game_status_test

✅ test_init
✅ test_init:0 [GameStatus.State.PLAYING, true]
✅ test_init:1 [GameStatus.State.X_WIN, true]
✅ test_init:2 [GameStatus.State.O_WIN, true]
✅ test_init:3 [GameStatus.State.DRAW, true]
✅ test_init:4 [-2, false]
✅ test_is_playing
✅ test_is_playing:0 [GameStatus.State.PLAYING, true]
✅ test_is_playing:1 [GameStatus.State.X_WIN, false]
✅ test_is_playing:2 [GameStatus.State.O_WIN, false]
✅ test_is_playing:3 [GameStatus.State.DRAW, false]
✅ test_get_result_test
✅ test_get_result_test:0 [GameStatus.State.PLAYING, 'Playing!?']
✅ test_get_result_test:1 [GameStatus.State.X_WIN, 'X Wins!']
✅ test_get_result_test:2 [GameStatus.State.O_WIN, 'O Wins!']
✅ test_get_result_test:3 [GameStatus.State.DRAW, 'Draw!']

✅ gameplay_test

✅ test_click_cell
✅ test_click_three_cells
✅ test_mark_fade_after_six_clicks
✅ test_mark_disappear_after_seven_clicks
✅ test_x_wins
✅ test_o_wins
✅ test_button_after_win

✅ init_test

✅ test_ready

✅ position_history_test

✅ test_init
✅ test_append
✅ test_append:0 [[BoardPosition.new(1, 2)], [BoardPosition.invalid, BoardPosition.invalid], ]
✅ test_append:1 [[BoardPosition.new(1, 2), BoardPosition.new(2, 0), BoardPosition.new(0, 1), BoardPosition.new(0, 0), BoardPosition.new(2, 0), BoardPosition.new(2, 0)], [BoardPosition.invalid, BoardPosition.new(1, 2)], ]
✅ test_append:2 [[BoardPosition.new(1, 2), BoardPosition.new(2, 0), BoardPosition.new(0, 1), BoardPosition.new(0, 0), BoardPosition.new(2, 0), BoardPosition.new(2, 0), BoardPosition.new(1, 2)], [BoardPosition.new(1, 2), BoardPosition.new(2, 0)], ]
✅ test_append:3 [[BoardPosition.new(1, 2), BoardPosition.new(2, 0), BoardPosition.new(0, 1), BoardPosition.new(0, 0), BoardPosition.new(2, 0), BoardPosition.new(2, 0), BoardPosition.new(1, 2), BoardPosition.new(2, 2)], [BoardPosition.new(2, 0), BoardPosition.new(0, 1)], ]

✅ ui_test

✅ test_click_cell
✅ test_click_three_cells
✅ test_mark_fade_after_six_clicks
✅ test_mark_disappear_after_seven_clicks
✅ test_reset_button