コード例 #1
0
ファイル: test_day01.py プロジェクト: sguberman/advent2016
 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)
コード例 #2
0
ファイル: test_day01.py プロジェクト: zhatt/adventofcode2019
 def test_part1_example4(self):
     result = day01.part1((100756, ))
     self.assertEqual(result, 33583)
コード例 #3
0
ファイル: test_day01.py プロジェクト: zhatt/adventofcode2019
 def test_part1_example3(self):
     result = day01.part1((1969, ))
     self.assertEqual(result, 654)
コード例 #4
0
ファイル: test_cases.py プロジェクト: barnybug/aoc2019
def test_day01_part1():
    assert day01.part1([12]) == 2
    assert day01.part1([14]) == 2
    assert day01.part1([1969]) == 654
    assert day01.part1([100756]) == 33583
コード例 #5
0
def test_part1():
    assert part1("day01/day01.dat") == 592
コード例 #6
0
ファイル: test_day01.py プロジェクト: zhatt/adventofcode2019
 def test_part1_example1(self):
     result = day01.part1((12, ))
     self.assertEqual(result, 2)
コード例 #7
0
ファイル: test_day01.py プロジェクト: zhatt/adventofcode2018
 def test_part1_example2(self):
     result = day01.part1((1, 1, 1))
     self.assertEqual(result, 3)
コード例 #8
0
def test_part1_mass_of_14():
    mass = 14
    assert day01.part1(mass) == 2
コード例 #9
0
ファイル: test_day01.py プロジェクト: cmcconomy/adventofcode
def test_part1():
    test_result1 = 7
    out = part1(test_input)
    print(out)
    assert (out == test_result1)
コード例 #10
0
def test_part1_mass_of_100756():
    mass = 100756
    assert day01.part1(mass) == 33583
コード例 #11
0
def test_part1_mass_of_12():
    mass = 12
    assert day01.part1(mass) == 2
コード例 #12
0
def test_part1_mass_of_1969():
    mass = 1969
    assert day01.part1(mass) == 654
コード例 #13
0
ファイル: test_day01.py プロジェクト: zhatt/adventofcode2018
 def test_part1_example4(self):
     result = day01.part1((-1, -2, -3))
     self.assertEqual(result, -6)
コード例 #14
0
ファイル: test_day01.py プロジェクト: zhatt/adventofcode2018
 def test_part1_example3(self):
     result = day01.part1((1, 1, -2))
     self.assertEqual(result, 0)
コード例 #15
0
ファイル: test_day01.py プロジェクト: zhatt/adventofcode2019
 def test_part1_total(self):
     result = day01.part1((12, 14))
     self.assertEqual(result, 4)
コード例 #16
0
def test_1_1_examples():
    examples = []
    for (inp, out) in examples:
        assert out == day01.part1(inp)
コード例 #17
0
ファイル: test_day01.py プロジェクト: zhatt/adventofcode2019
 def test_part1_input(self):
     result = day01.part1(aoc.read_input('day01.input'))
     self.assertEqual(result, 3406432)
コード例 #18
0
ファイル: test_day01.py プロジェクト: sguberman/advent2019
def test_part1():
    assert day01.part1('input_day01.txt') == 3317659
コード例 #19
0
def test_day1_part1():
    assert part1([1721, 979, 366, 299, 675, 1456]) == 514579
コード例 #20
0
ファイル: test_day01.py プロジェクト: sguberman/advent2020
def test_part1(puzzle_input, expected):
    assert part1(puzzle_input) == expected