2022 Day 06

This commit is contained in:
Akumatic
2022-12-06 08:08:44 +01:00
parent 9f4a2006aa
commit 8879b7c1c8
6 changed files with 101 additions and 1 deletions

18
2022/06/test_code.py Normal file
View File

@ -0,0 +1,18 @@
# SPDX-License-Identifier: MIT
# Copyright (c) 2022 Akumatic
from code import part1, part2
def test():
inputs = ["mjqjpqmgbljsphdztnvjfqwrcgsmlb", "bvwbjplbgvbhsrlpgdmjqwftvncz",
"nppdvjthqldpwncqszvftbrmjlhg", "nznrnfrfntjfmvfwmzdfjlvtqnbhcprsg", "zcfzfwzzqfrljwzlrfnpqdbhtmscgvjw"]
expected_values = [(7, 19), (5, 23), (6, 23), (10, 29), (11, 26)]
for i in range(len(inputs)):
assert part1(inputs[i]) == expected_values[i][0]
print("Passed Part 1")
for i in range(len(inputs)):
assert part2(inputs[i]) == expected_values[i][1]
print("Passed Part 2")
if __name__ == "__main__":
test()