From 976e2edcf3bbd01b0045c7f1731022bf9cd58bcc Mon Sep 17 00:00:00 2001 From: Rodrigo Mesquita <169096775+isiy0@users.noreply.github.com> Date: Fri, 15 May 2026 11:16:08 -0300 Subject: [PATCH] Add missing edge cases tests for win function in ghost-gobble-arcade-game Added two test cases for the win function that were missing: 1) win(True, True, False) to ensure players win when invincible but not touching a ghost. 2) win(False, False, False) to ensure players don't win simply by not touching a ghost without having eaten the dots. --- .../arcade_game_test.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/exercises/concept/ghost-gobble-arcade-game/arcade_game_test.py b/exercises/concept/ghost-gobble-arcade-game/arcade_game_test.py index 4dc3ca4c56d..233a455b037 100644 --- a/exercises/concept/ghost-gobble-arcade-game/arcade_game_test.py +++ b/exercises/concept/ghost-gobble-arcade-game/arcade_game_test.py @@ -142,3 +142,24 @@ def test_dont_win_if_not_all_dots_eaten(self): self.assertIs(actual_result, False, msg=error_message) + @pytest.mark.task(taskno=4) + def test_win_if_all_dots_eaten_with_power_pellet_and_not_touching_ghost(self): + actual_result = win(True, True, False) + error_message = ('Called win(True, True, False).' + f'The function returned {actual_result}, but the ' + f'tests expected that the player wins, ' + f'because all dots were eaten and they were not ' + f'touching a ghost.') + + self.assertIs(actual_result, True, msg=error_message) + + @pytest.mark.task(taskno=4) + def test_dont_win_if_not_all_dots_eaten_and_not_touching_ghost(self): + actual_result = win(False, False, False) + error_message = ('Called win(False, False, False).' + f'The function returned {actual_result}, but the ' + f'tests expected that the player **does not** win, ' + f'because the player did not eat all of the dots.') + + self.assertIs(actual_result, False, msg=error_message) +