Skip to content

Commit b585b68

Browse files
committed
bowling: Split test to fall in line with canonical_data
1 parent f4e995a commit b585b68

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

exercises/practice/bowling/tests/bowling.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ fn second_bonus_roll_after_a_strike_in_the_last_frame_cannot_score_more_than_10_
360360

361361
#[test]
362362
#[ignore]
363-
fn if_the_last_frame_is_a_strike_you_cannot_score_before_the_extra_rolls_are_taken() {
363+
fn bonus_rolls_for_a_strike_in_the_last_frame_must_be_rolled_before_score_can_be_calculated() {
364364
let mut game = BowlingGame::new();
365365

366366
for _ in 0..18 {
@@ -370,13 +370,22 @@ fn if_the_last_frame_is_a_strike_you_cannot_score_before_the_extra_rolls_are_tak
370370
let _ = game.roll(10);
371371

372372
assert_eq!(game.score(), None);
373+
}
373374

374-
let _ = game.roll(10);
375+
#[test]
376+
#[ignore]
377+
fn both_bonus_rolls_for_a_strike_in_the_last_frame_must_be_rolled_before_score_can_be_calculated() {
378+
let mut game = BowlingGame::new();
375379

376-
assert_eq!(game.score(), None);
380+
for _ in 0..18 {
381+
let _ = game.roll(0);
382+
}
377383

378384
let _ = game.roll(10);
385+
let _ = game.roll(10);
386+
assert_eq!(game.score(), None);
379387

388+
let _ = game.roll(10);
380389
assert!(game.score().is_some());
381390
}
382391

0 commit comments

Comments
 (0)