diff --git a/exercises/practice/bowling/.meta/tests.toml b/exercises/practice/bowling/.meta/tests.toml index 963df175..19042607 100644 --- a/exercises/practice/bowling/.meta/tests.toml +++ b/exercises/practice/bowling/.meta/tests.toml @@ -1,6 +1,13 @@ -# This is an auto-generated file. Regular comments will be removed when this -# file is regenerated. Regenerating will not touch any manually added keys, -# so comments can be added in a "comment" key. +# This is an auto-generated file. +# +# Regenerating this file via `configlet sync` will: +# - Recreate every `description` key/value pair +# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications +# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion) +# - Preserve any other key/value pair +# +# As user-added comments (using the # character) will be removed when this file +# is regenerated, comments can be added via a `comment` key. [656ae006-25c2-438c-a549-f338e7ec7441] description = "should be able to score a game with all zeros" @@ -38,6 +45,9 @@ description = "rolling a spare with the two roll bonus does not get a bonus roll [576faac1-7cff-4029-ad72-c16bcada79b5] description = "strikes with the two roll bonus do not get bonus rolls" +[efb426ec-7e15-42e6-9b96-b4fca3ec2359] +description = "last two strikes followed by only last bonus with non strike points" + [72e24404-b6c6-46af-b188-875514c0377b] description = "a strike with the one roll bonus after a spare in the last frame does not get a bonus" diff --git a/exercises/practice/bowling/bowling_spec.lua b/exercises/practice/bowling/bowling_spec.lua index 4e1f3c70..1f850566 100644 --- a/exercises/practice/bowling/bowling_spec.lua +++ b/exercises/practice/bowling/bowling_spec.lua @@ -94,6 +94,15 @@ describe('bowling', function() assert.equal(18, scorer.score()) end) + it('should correctly score last two strikes followed by only last bonus with points', function() + roll_n_times(0, 16) + scorer.roll(10) + scorer.roll(10) + scorer.roll(0) + scorer.roll(1) + assert.equal(31, scorer.score()) + end) + it('should not allow a bonus roll after rolling a spare after a strike on the last frame', function() roll_n_times(0, 18) scorer.roll(10)