Ejemplo n.º 1
0
def test_day10_part1():
    assert day10.part1('''.#..#
.....
#####
....#
...##''') == ((3, 4), 8)
    assert day10.part1('''......#.#.
#..#.#....
..#######.
.#.#.###..
.#..#.....
..#....#.#
#..#....#.
.##.#..###
##...#..#.
.#....####''') == ((5, 8), 33)
    assert day10.part1('''#.#...#.#.
.###....#.
.#....#...
##.#.#.#.#
....#.#.#.
.##..###.#
..#...##..
..##....##
......#...
.####.###.''') == ((1, 2), 35)
    assert day10.part1('''.#..#..###
####.###.#
....###.#.
..###.##.#
##.##.#.#.
....###..#
..#.#..#.#
#..#.#.###
.##...##.#
.....#.#..''') == ((6, 3), 41)
    assert day10.part1('''.#..##.###...#######
##.############..##.
.#.######.########.#
.###.#######.####.#.
#####.##.#.##.###.##
..#####..#.#########
####################
#.####....###.#.#.##
##.#################
#####.##.###..####..
..######..##.#######
####.##.####...##..#
.#####..#.######.###
##...#.##########...
#.##########.#######
.####.#.###.###.#.##
....##.##.###..#####
.#.#.###########.###
#.#.#.#####.####.###
###.##.####.##.#..##''') == ((11, 13), 210)
Ejemplo n.º 2
0
def test_ast_count():
    lines = ['.#..#','.....','#####','....#','...##']
    (field,x,y) = day10.genField(lines)
    v = day10.genVectors(max(x,y))
    (ba, num) = day10.part1(field,v)
    assert ba == 3+4j
    assert num == 8
Ejemplo n.º 3
0
    def test_second_example(self):
        f = 'day10-test2.txt'
        input_list: List[int] = common.read_list(f)
        input_list = day10.prep_list(input_list)

        answer: int = day10.part1(input_list)

        self.assertEqual(220, answer)
Ejemplo n.º 4
0
def test_destoyer():
    lines = ['.#....#####...#..','##...##.#####..##','##...#...#.#####.','..#.....#...###..','..#.#.....#....##']
    (field,x,y) = day10.genField(lines)
    v = day10.genVectors(max(x,y))
    (ba, num) = day10.part1(field,v)
    print(ba)
    la = day10.part2(field,v,ba,36)
    assert la == (14+3j)
Ejemplo n.º 5
0
    def test_part1_example1(self):
        input_list = [
            ".#..#",
            ".....",
            "#####",
            "....#",
            "...##",
        ]

        result = day10.part1(input_list)
        self.assertEqual(8, result)
Ejemplo n.º 6
0
 def test_part1(self):
     length = 256
     inputs = parse_nums("../input.txt")
     p1_ans = part1(length, inputs)
     self.assertEqual(p1_ans, 2928)
Ejemplo n.º 7
0
 def test_part1_input(self):
     result = day10.part1(aoc.read_input('day10.input'))
     self.assertEqual(result, '\n'.join(self.input_solution))
Ejemplo n.º 8
0
def test_part1(puzzle_input, answer):
    assert part1(puzzle_input) == answer
Ejemplo n.º 9
0
 def test_part1_2(self):
     grid = parse("../input_small2.txt")
     (x, y, count) = part1(grid)
     self.assertEqual(x, 5)
     self.assertEqual(y, 8)
     self.assertEqual(count, 33)
Ejemplo n.º 10
0
 def test_part1_example_small(self):
     self.assertEqual(7 * 5,
                      day10.part1("../inputs/day10_example_small.txt"))
Ejemplo n.º 11
0
 def test_part1_example1(self):
     result = day10.part1(self.example)
     self.assertEqual(result, '\n'.join(self.example_solution))
Ejemplo n.º 12
0
def test_part1_sample(sample_data):
    assert part1(sample_data) == 35
Ejemplo n.º 13
0
 def test_part1_5(self):
     grid = parse("../input_small5.txt")
     (x, y, count) = part1(grid)
     self.assertEqual(x, 11)
     self.assertEqual(y, 13)
     self.assertEqual(count, 210)
Ejemplo n.º 14
0
def test_day10_part1a():
    assert day10.part1(day10_1) == 7 * 5
Ejemplo n.º 15
0
 def test_part1_3(self):
     grid = parse("../input_small3.txt")
     (x, y, count) = part1(grid)
     self.assertEqual(x, 1)
     self.assertEqual(y, 2)
     self.assertEqual(count, 35)
Ejemplo n.º 16
0
def test_10_1_examples():
    examples = []
    for (inp, out) in examples:
        assert out == day10.part1(inp)
Ejemplo n.º 17
0
 def test_part1_1(self):
     grid = parse("../input_small.txt")
     (x, y, count) = part1(grid)
     self.assertEqual(x, 3)
     self.assertEqual(y, 4)
     self.assertEqual(count, 8)
Ejemplo n.º 18
0
 def test_part1_main(self):
     grid = parse("../input.txt")
     (x, y, count) = part1(grid)
     self.assertEqual(x, 11)
     self.assertEqual(y, 11)
     self.assertEqual(count, 221)
Ejemplo n.º 19
0
def test_part1():
    assert part1() == 1935
Ejemplo n.º 20
0
 def test_part1_example_large(self):
     self.assertEqual(22 * 10,
                      day10.part1("../inputs/day10_example_large.txt"))
Ejemplo n.º 21
0
def test_day10_part1b():
    assert day10.part1(day10_2) == 22 * 10
Ejemplo n.º 22
0
 def test_part1_4(self):
     grid = parse("../input_small4.txt")
     (x, y, count) = part1(grid)
     self.assertEqual(x, 6)
     self.assertEqual(y, 3)
     self.assertEqual(count, 41)
Ejemplo n.º 23
0
def test_part1_input(input_data):
    assert part1(input_data) == 2343
Ejemplo n.º 24
0
 def test_part1_example5(self):
     result = day10.part1(self.input_list_example5)
     self.assertEqual(210, result)
Ejemplo n.º 25
0
def test_day10_part_1():
    number_list = [int(i) for i in test_input_data]
    assert day10.part1(number_list) == 220
Ejemplo n.º 26
0
 def test_part1_input(self):
     result = day10.part1(aoc.read_input('day10.input'))
     self.assertEqual(269, result)
Ejemplo n.º 27
0
 def test_part1(self):
     self.assertEqual(1917, day10.part1("../inputs/day10.txt"))
Ejemplo n.º 28
0
def test_day10_part1():
    data1 = int_array_from_list("10.txt", test=True)
    data2 = int_array_from_list("10b.txt", test=True)
    assert day10.part1(data1) == (7 * 5)
    assert day10.part1(data2) == (22 * 10)
Ejemplo n.º 29
0
def test_part1():
    assert part1(test_input) == 26397
Ejemplo n.º 30
0
 def test_part1_larger_example(self):
     self.assertEqual(day10.part1(self.exampleInputLrg), 220)