Skip to content

Commit

Permalink
test: add test case for hands with jokers
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelblijleven committed Dec 8, 2023
1 parent ca6497b commit 4f08dd9
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/adventofcode/year_2023/test_day_07_2023.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_parse_input():


@pytest.mark.parametrize(["hand", "expected"], [
("32T3K", hands["High card"]),
("32T3K", hands["One pair"]),
("T55J5", hands["Three of a kind"]),
("KK677", hands["Two pair"]),
("KTJJT", hands["Two pair"]),
Expand All @@ -32,7 +32,21 @@ def test_parse_input():
("AAAKK", hands["Full house"]),
])
def test_parse_hand(hand, expected):
assert parse_hand(hand) == expected
assert parse_hand(hand, with_jokers=False) == expected


@pytest.mark.parametrize(["hand", "expected"], [
("32T3K", hands["One pair"]),
("T55J5", hands["Four of a kind"]),
("KK677", hands["Two pair"]),
("KTJJT", hands["Four of a kind"]),
("QQQJA", hands["Four of a kind"]),
("AAAAA", hands["Five of a kind"]),
("AAAAK", hands["Four of a kind"]),
("AAAKK", hands["Full house"]),
])
def test_parse_hand_with_joker(hand, expected):
assert parse_hand(hand, with_jokers=True) == expected


def test_part_one():
Expand Down

0 comments on commit 4f08dd9

Please sign in to comment.