From f3d0899dbfd0aa3e6aebf5d19ec89d58ead418b2 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Mon, 19 Dec 2022 09:30:43 +0100 Subject: Day 18 --- aoc/tests/__init__.py | 0 aoc/tests/test_datastructures.py | 16 ++++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 aoc/tests/__init__.py create mode 100644 aoc/tests/test_datastructures.py (limited to 'aoc/tests') diff --git a/aoc/tests/__init__.py b/aoc/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/aoc/tests/test_datastructures.py b/aoc/tests/test_datastructures.py new file mode 100644 index 0000000..a7965f5 --- /dev/null +++ b/aoc/tests/test_datastructures.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +from aoc.datastructures import Coordinate3 + + +class TestCoordinate3: + def test_neighbours_nodiagonal(self): + coordinate = Coordinate3(0, 0, 0) + + assert set(coordinate.neighbours(True)) == { + Coordinate3(-1, 0, 0), + Coordinate3(1, 0, 0), + Coordinate3(0, -1, 0), + Coordinate3(0, 1, 0), + Coordinate3(0, 0, -1), + Coordinate3(0, 0, 1), + } -- cgit v1.2.3