Пример #1
0
from day9 import part1
from day9 import part2
test_data = [
    35, 20, 15, 25, 47, 40, 62, 55, 65, 95, 102, 117, 150, 182, 127, 219, 299,
    277, 309, 576
]
test_output = 127
test_output2 = 62
preamble = 5

#if part1(test_data, preamble) == test_output:
#    print(f"Test successful with value {part1(test_data, preamble)}")
#else:
#    print(f"Test failed with value {part1(test_data, preamble)}")

if part2(test_data, preamble) == test_output2:
    print("Test successful")
else:
    print(part2(test_data, preamble))
Пример #2
0
def test_day9_part2():
    data = int_array_from_list("9.txt", test=True)
    assert day9.part2(data, 127) == 62
Пример #3
0
def test_day9_part_2():
    number_list = [int(i) for i in input_data]
    test_number_list = [int(i) for i in test_input_data]
    assert day9.part2(test_number_list, 127) == 62
    assert day9.part2(number_list, 1124361034) == 129444555
Пример #4
0
 def test_part2(self):
     self.assertEqual(35602097, part2())
Пример #5
0
def test_part2():
    assert part2(test_input) == 1134
Пример #6
0
 def test_part2(self):
     self.assertEqual(day9.part2(self.exampleInput, invalid_n = 127),62)
Пример #7
0
 def test_part2(self):
     self.assertEqual(
         11691646,
         day9.part2("../inputs/day9.txt", 90433990)
     )
Пример #8
0
 def test_part2_example(self):
     self.assertEqual(
         62,
         day9.part2("../inputs/day9_example.txt", 127)
     )