Sha256: 2c18b71b20c79d7ef0422544c6dd129a423737aa7fab4c0fa7326f50446a22fd
Contents?: true
Size: 1.05 KB
Versions: 39
Compression:
Stored size: 1.05 KB
Contents
(ns dominoes-test (:require [clojure.test :refer [deftest is]] [dominoes :refer [can-chain?]])) (deftest empty-input-empty-output (is (can-chain? []))) (deftest singleton-input-singleton-output (is (can-chain? [[1 1]]))) (deftest singleton-that-cant-be-chained (is ((comp not can-chain?) [[1 2]]))) (deftest three-elements (is (can-chain? [[1 2] [3 1] [2 3]]))) (deftest can-reverse-dominoes (is (can-chain? [[1 2] [1 3] [2 3]]))) (deftest cant-be-chained (is ((comp not can-chain?) [[1 2] [4 1] [2 3]]))) (deftest disconnected-simple (is ((comp not can-chain?) [[1 1] [2 2]]))) (deftest disconnected-double-loop (is ((comp not can-chain?) [[1 2] [2 1] [3 4] [4 3]]))) (deftest disconnected-single-isolated (is ((comp not can-chain?) [[1 2] [2 3] [3 1] [4 4]]))) (deftest need-backtrack (is (can-chain? [[1 2] [2 3] [3 1] [2 4] [2 4]]))) (deftest separate-loops (is (can-chain? [[1 2] [2 3] [3 1] [1 1] [2 2] [3 3]]))) (deftest nine-elements (is (can-chain? [[1 2] [5 3] [3 1] [1 2] [2 4] [1 6] [2 3] [3 4] [5 6]])))
Version data entries
39 entries across 39 versions & 1 rubygems