diff options
| author | 2022-12-12 21:18:08 +0100 | |
|---|---|---|
| committer | 2022-12-12 21:18:08 +0100 | |
| commit | 9ba6ef9d5eeb1e093b2072c10b5092d829594d3b (patch) | |
| tree | 836dcb473bb39b2bdca26a9e69a14aea16eadd27 /day9/test_init.py | |
| parent | 968ade2c193d80db7a6170ee1eb44e120aa00992 (diff) | |
| download | 2022-9ba6ef9d5eeb1e093b2072c10b5092d829594d3b.tar.gz 2022-9ba6ef9d5eeb1e093b2072c10b5092d829594d3b.tar.bz2 2022-9ba6ef9d5eeb1e093b2072c10b5092d829594d3b.zip | |
Day 9
Diffstat (limited to 'day9/test_init.py')
| -rw-r--r-- | day9/test_init.py | 25 |
1 files changed, 25 insertions, 0 deletions
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: | |||
| 75 | assignment.visualize(range(1), range(-5, 1), unique_positions) == expected | 75 | assignment.visualize(range(1), range(-5, 1), unique_positions) == expected |
| 76 | ) | 76 | ) |
| 77 | 77 | ||
| 78 | def test_diagonal(self): | ||
| 79 | expected = "\n".join( | ||
| 80 | [ | ||
| 81 | "..#", | ||
| 82 | ".#.", | ||
| 83 | "s..", | ||
| 84 | ] | ||
| 85 | ) | ||
| 86 | |||
| 87 | input = [ | ||
| 88 | "R 1", | ||
| 89 | "U 1", | ||
| 90 | "R 1", | ||
| 91 | "U 1", | ||
| 92 | "R 1", | ||
| 93 | "U 1", | ||
| 94 | "R 1", | ||
| 95 | "U 1", | ||
| 96 | ] | ||
| 97 | |||
| 98 | assignment = day9.AssignmentOne(path=os.path.dirname(day9.__file__)) | ||
| 99 | unique_positions = assignment.unique_tail_positions(input=input, length=2) | ||
| 100 | |||
| 101 | assert assignment.visualize(range(3), range(3), unique_positions) == expected | ||
| 102 | |||
| 78 | 103 | ||
| 79 | class TestAssignmentOne: | 104 | class TestAssignmentOne: |
| 80 | def test_output_visualization(self): | 105 | def test_output_visualization(self): |
