From 9ba6ef9d5eeb1e093b2072c10b5092d829594d3b Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Mon, 12 Dec 2022 21:18:08 +0100 Subject: Day 9 --- day9/test_init.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'day9/test_init.py') diff --git a/day9/test_init.py b/day9/test_init.py index eb889c7..431dbbb 100644 --- a/day9/test_init.py +++ b/day9/test_init.py @@ -75,6 +75,31 @@ class TestAssignment: assignment.visualize(range(1), range(-5, 1), unique_positions) == expected ) + def test_diagonal(self): + expected = "\n".join( + [ + "..#", + ".#.", + "s..", + ] + ) + + input = [ + "R 1", + "U 1", + "R 1", + "U 1", + "R 1", + "U 1", + "R 1", + "U 1", + ] + + assignment = day9.AssignmentOne(path=os.path.dirname(day9.__file__)) + unique_positions = assignment.unique_tail_positions(input=input, length=2) + + assert assignment.visualize(range(3), range(3), unique_positions) == expected + class TestAssignmentOne: def test_output_visualization(self): -- cgit v1.2.3