From b9b3a1e024e0217fa525000400ae03e042c12a9d Mon Sep 17 00:00:00 2001 From: Jack Grahl Date: Sun, 6 Mar 2022 12:40:41 +0000 Subject: [PATCH 1/2] New prerelease version. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 332018a..a98249d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "exact_cover" -version = "1.0.0-alpha.0" +version = "1.0.0-alpha.1" description = "Solve exact cover problems" readme = "README.md" authors = ["Moy Easwaran"] From ed6b4c0515c6cca485061f9d24293c6e38be3234 Mon Sep 17 00:00:00 2001 From: Jack Grahl Date: Sat, 14 May 2022 16:11:41 +0100 Subject: [PATCH 2/2] Add basic tests for debug mode. --- tests/test_debug.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/test_debug.py diff --git a/tests/test_debug.py b/tests/test_debug.py new file mode 100644 index 0000000..e7ed698 --- /dev/null +++ b/tests/test_debug.py @@ -0,0 +1,23 @@ +import numpy as np +import pytest + +from hypothesis import given + +from exact_cover import get_exact_cover +from exact_cover.error import NoSolution +from .helpers.polyomino_data import polyomino_problem +from .test_exact_cover_problems import large_problems_without_solution + + +def test_exact_cover_debug_on(): + data = np.array([[1, 0, 0], [0, 1, 0], [0, 1, 1], [0, 0, 1]], dtype=np.int32) + expected = np.array([0, 1, 3]) + actual = get_exact_cover(data, debug=True) + np.testing.assert_array_equal(actual, expected) + + +def test_exact_cover_debug_off(): + data = np.array([[1, 0, 0], [0, 1, 0], [0, 1, 1], [0, 0, 1]], dtype=np.int32) + expected = np.array([0, 1, 3]) + actual = get_exact_cover(data, debug=False) + np.testing.assert_array_equal(actual, expected)