Skip to content

Commit

Permalink
Add another test for the last frame
Browse files Browse the repository at this point in the history
If the first roll in the last frame is not a strike, then ensure that the next roll (i.e. the second roll in the last frame) pin count is less than or equal to the remaining number of pins.
  • Loading branch information
dsardelic authored Sep 2, 2023
1 parent b287cf5 commit 3cfabbe
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions exercises/bowling/canonical-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,18 @@
"expected": {
"error": "Cannot roll after game is over"
}
},
{
"uuid": "288f7585-ab70-4dfe-88e8-25fab199eff2",
"description": "second roll in the last frame cannot score more than 10 points if the first roll in the last frame is not a strike",
"property": "roll",
"input": {
"previousRolls": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7],
"roll": 4
},
"expected": {
"error": "Pin count exceeds pins on the lane"
}
}
]
}

0 comments on commit 3cfabbe

Please sign in to comment.