def test_task1(self): self.assertEqual(task1(["s1"], list("abcde")), "eabcd") self.assertEqual(task1(["x3/4"], list("abcde")), "abced") self.assertEqual(task1(["pe/b"], list("abcde")), "aecdb") self.assertEqual(task1(["s1", "x3/4", "pe/b"], list("abcde")), "baedc") self.assertEqual( task1(read_moves("input.txt"), list("abcdefghijklmnop")), "bijankplfgmeodhc")
def test_task1(self): self.assertEqual(task1("{}")[1], 1) self.assertEqual(task1("{{{}}}")[1], 6) self.assertEqual(task1("{{},{}}")[1], 5) self.assertEqual(task1("{{{},{},{{}}}}")[1], 16) self.assertEqual(task1("{<a>,<a>,<a>,<a>}")[1], 1) self.assertEqual(task1("{{<ab>},{<ab>},{<ab>},{<ab>}}")[1], 9) self.assertEqual(task1("{{<!!>},{<!!>},{<!!>},{<!!>}}")[1], 9) self.assertEqual(task1("{{<a!>},{<a!>},{<a!>},{<ab>}}")[1], 3) self.assertEqual(task1(read("input.txt"))[1], 10800)
def test_task2(self): self.assertEqual(task1("<>")[0], 0) self.assertEqual(task1("<random characters>")[0], 17) self.assertEqual(task1("<<<<>")[0], 3) self.assertEqual(task1("<{!>}>")[0], 2) self.assertEqual(task1("<!!>")[0], 0) self.assertEqual(task1("<!!!>>")[0], 0) self.assertEqual(task1('<{o"i!a,<{i<a>')[0], 10) self.assertEqual(task1(read("input.txt"))[0], 4522)
def test_task1(self): self.assertEquals(task1(get_map("test.txt")), 6) self.assertEquals(task1(get_map("input.txt")), 130)
def test_task1(self): self.assertEqual(task1([0, 3, 0, 1, -3]), 5) self.assertEqual(task1(read_input()), 343467)
def test_task1(self): self.assertEqual(task1("flqrgnkx"), 8108) self.assertEqual(task1("ljoxqyyw"), 8316)
def test_task1(self): self.assertEqual(task1("example.txt"), "tknk") self.assertEqual(task1("input.txt"), "rqwgj")
def test_task1(self): self.assertEqual(task1(3, 2017), 638) self.assertEqual(task1(328, 2017), 1670)
def test_task1(self): self.assertEquals(task1("ne,ne,ne".split(",")), 3) self.assertEquals(task1("ne,ne,sw,sw".split(",")), 0) self.assertEquals(task1("ne,ne,s,s".split(",")), 2) self.assertEquals(task1("se,sw,se,sw,sw".split(",")), 3) self.assertEquals(task1(read("input.txt")), 773)
def test_task1(self): self.assertEqual(task1("test.txt"), 1) self.assertEqual(task1("input.txt"), 6611)
def test_task1(self): self.assertEqual(task1("test.txt"), ("ABCDEF", 38)) self.assertEqual(task1("input.txt"), ("VEBTPXCHLI", 18702))
def test_task1(self): self.assertEquals(task1(), 386)
def test_task1(self): self.assertEqual(task1(5, [3, 4, 1, 5]), 12) self.assertEqual(task1(256, read("input.txt")), 4114)
def test_task1(self): self.assertEqual(task1([0, 2, 7, 0]), 5) self.assertEqual(task1(read_input()), 4074)
def test_task1(self): self.assertEqual(task1(65, 8921, 5), 1) self.assertEqual(task1(65, 8921, 40 * 1000 * 1000), 588) self.assertEqual(task1(722, 354, 40 * 1000 * 1000), 612)