Esempio n. 1
0
 def test_part1(self):
     instructions = ['R2', 'L3']
     self.assertEqual(part1(instructions), 5)
     instructions = ['R2', 'R2', 'R2']
     self.assertEqual(part1(instructions), 2)
     instructions = ['R5', 'L5', 'R5', 'R3']
     self.assertEqual(part1(instructions), 12)
Esempio n. 2
0
 def test_part1_example4(self):
     result = day01.part1((100756, ))
     self.assertEqual(result, 33583)
Esempio n. 3
0
 def test_part1_example3(self):
     result = day01.part1((1969, ))
     self.assertEqual(result, 654)
Esempio n. 4
0
def test_day01_part1():
    assert day01.part1([12]) == 2
    assert day01.part1([14]) == 2
    assert day01.part1([1969]) == 654
    assert day01.part1([100756]) == 33583
Esempio n. 5
0
def test_part1():
    assert part1("day01/day01.dat") == 592
Esempio n. 6
0
 def test_part1_example1(self):
     result = day01.part1((12, ))
     self.assertEqual(result, 2)
Esempio n. 7
0
 def test_part1_example2(self):
     result = day01.part1((1, 1, 1))
     self.assertEqual(result, 3)
def test_part1_mass_of_14():
    mass = 14
    assert day01.part1(mass) == 2
Esempio n. 9
0
def test_part1():
    test_result1 = 7
    out = part1(test_input)
    print(out)
    assert (out == test_result1)
def test_part1_mass_of_100756():
    mass = 100756
    assert day01.part1(mass) == 33583
def test_part1_mass_of_12():
    mass = 12
    assert day01.part1(mass) == 2
def test_part1_mass_of_1969():
    mass = 1969
    assert day01.part1(mass) == 654
Esempio n. 13
0
 def test_part1_example4(self):
     result = day01.part1((-1, -2, -3))
     self.assertEqual(result, -6)
Esempio n. 14
0
 def test_part1_example3(self):
     result = day01.part1((1, 1, -2))
     self.assertEqual(result, 0)
Esempio n. 15
0
 def test_part1_total(self):
     result = day01.part1((12, 14))
     self.assertEqual(result, 4)
Esempio n. 16
0
def test_1_1_examples():
    examples = []
    for (inp, out) in examples:
        assert out == day01.part1(inp)
Esempio n. 17
0
 def test_part1_input(self):
     result = day01.part1(aoc.read_input('day01.input'))
     self.assertEqual(result, 3406432)
Esempio n. 18
0
def test_part1():
    assert day01.part1('input_day01.txt') == 3317659
def test_day1_part1():
    assert part1([1721, 979, 366, 299, 675, 1456]) == 514579
Esempio n. 20
0
def test_part1(puzzle_input, expected):
    assert part1(puzzle_input) == expected