Skip to content

Commit

Permalink
Don't check error message
Browse files Browse the repository at this point in the history
  • Loading branch information
keiravillekode committed Oct 4, 2024
1 parent b2a4894 commit e343603
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ return {
}
assert.has.error(function()
state_of_tic_tac_toe.gamestate(board)
end, '%s')]]
return template:format(render_board(case.input.board), case.expected.error)
end)]]
return template:format(render_board(case.input.board))
end
end
}
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ describe('state-of-tic-tac-toe', function()
}
assert.has.error(function()
state_of_tic_tac_toe.gamestate(board)
end, 'Wrong turn order: X went twice')
end)
end)

it('invalid board: o started', function()
Expand All @@ -243,18 +243,7 @@ describe('state-of-tic-tac-toe', function()
}
assert.has.error(function()
state_of_tic_tac_toe.gamestate(board)
end, 'Wrong turn order: O started')
end)

it('invalid board', function()
local board = {
'XXX', --
'OOO', --
' ' --
}
assert.has.error(function()
state_of_tic_tac_toe.gamestate(board)
end, 'Impossible board: game should have ended after X won')
end)
end)

it('invalid board: x won and o kept playing', function()
Expand All @@ -265,7 +254,7 @@ describe('state-of-tic-tac-toe', function()
}
assert.has.error(function()
state_of_tic_tac_toe.gamestate(board)
end, 'Impossible board: game should have ended after the game was won')
end)
end)

it('invalid board: players kept playing after a win', function()
Expand All @@ -276,7 +265,7 @@ describe('state-of-tic-tac-toe', function()
}
assert.has.error(function()
state_of_tic_tac_toe.gamestate(board)
end, 'Impossible board: game should have ended after the game was won')
end)
end)
end)
end)

0 comments on commit e343603

Please sign in to comment.