Skip to content

Commit

Permalink
test: day02
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ong committed Dec 23, 2023
1 parent e1fe340 commit 79fb9cc
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions day02/tests/test_day2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from day02.day2 import INPUT_SMALL, Game, game_filter, get_games, part1, part2
from day02.day2 import INPUT_SMALL, Draw, Game, game_filter, get_games, part1, part2


def get_game1() -> Game:
Expand All @@ -9,8 +9,17 @@ def get_game2() -> Game:
return Game("Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue")


def test_draw() -> None:
"""Test draws"""
draw1: Draw = Draw("3 blue, 4 red")
draw2: Draw = Draw("4 blue, 3 green")

assert [draw1.red, draw1.green, draw1.blue] == [4, 0, 3]
assert [draw2.red, draw2.green, draw2.blue] == [0, 3, 4]


def test_game() -> None:
# constructor:
"""Test games"""
game1: Game = get_game1()
game2: Game = get_game2()

Expand Down

0 comments on commit 79fb9cc

Please sign in to comment.