Step 3
TirSystem/github-action: Sync GitHub mirror metadata / sync-metadata (push) Successful in 5s

Checking if the player has won
This commit is contained in:
2026-10-04 12:40:15 +08:00
parent 15d5f7134d
commit ce87f23314
6 changed files with 66 additions and 24 deletions
+15
View File
@@ -30,3 +30,18 @@ def test_wrong_guess_keeps_blanks():
g = Game("cat")
assert g.guess("z") is False
assert g.display() == "_ _ _"
def test_not_won_until_all_letters_guessed():
g = Game("hi")
assert not g.won
g.guess("h")
assert not g.won
g.guess("i")
assert g.won
def test_wrong_guesses_do_not_win():
g = Game("hi")
g.guess("x")
assert not g.won