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

Version Path
trackler-2.2.1.180 tracks/clojure/exercises/dominoes/test/dominoes_test.clj
trackler-2.2.1.179 tracks/clojure/exercises/dominoes/test/dominoes_test.clj
trackler-2.2.1.178 tracks/clojure/exercises/dominoes/test/dominoes_test.clj
trackler-2.2.1.177 tracks/clojure/exercises/dominoes/test/dominoes_test.clj
trackler-2.2.1.176 tracks/clojure/exercises/dominoes/test/dominoes_test.clj
trackler-2.2.1.175 tracks/clojure/exercises/dominoes/test/dominoes_test.clj
trackler-2.2.1.174 tracks/clojure/exercises/dominoes/test/dominoes_test.clj
trackler-2.2.1.173 tracks/clojure/exercises/dominoes/test/dominoes_test.clj
trackler-2.2.1.172 tracks/clojure/exercises/dominoes/test/dominoes_test.clj
trackler-2.2.1.171 tracks/clojure/exercises/dominoes/test/dominoes_test.clj
trackler-2.2.1.170 tracks/clojure/exercises/dominoes/test/dominoes_test.clj
trackler-2.2.1.169 tracks/clojure/exercises/dominoes/test/dominoes_test.clj
trackler-2.2.1.167 tracks/clojure/exercises/dominoes/test/dominoes_test.clj
trackler-2.2.1.166 tracks/clojure/exercises/dominoes/test/dominoes_test.clj
trackler-2.2.1.165 tracks/clojure/exercises/dominoes/test/dominoes_test.clj
trackler-2.2.1.164 tracks/clojure/exercises/dominoes/test/dominoes_test.clj
trackler-2.2.1.163 tracks/clojure/exercises/dominoes/test/dominoes_test.clj
trackler-2.2.1.162 tracks/clojure/exercises/dominoes/test/dominoes_test.clj
trackler-2.2.1.161 tracks/clojure/exercises/dominoes/test/dominoes_test.clj
trackler-2.2.1.160 tracks/clojure/exercises/dominoes/test/dominoes_test.clj