Skip to content

Commit b18fe2a

Browse files
committed
Added test for creating a board matrix from a 1-line string.
1 parent 7512df3 commit b18fe2a

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

test/boggle/core_test.clj

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(ns boggle.core-test
22
(:require [clojure.test :refer :all]
3-
[boggle.core :refer :all]))
3+
[boggle.core :refer :all]
4+
[boggle.utils]))
45

56
(deftest test-valid-word?
67
(testing "valid-word?"
@@ -127,3 +128,13 @@
127128
[["A" "B" "C"]
128129
["D" "E" "F"]
129130
["P" "QU" "R"]])))))
131+
132+
(deftest test-load-board-from-string
133+
(testing "correctly parses a 1-line string into a board matrix"
134+
(let [board (boggle.utils/str->board "abcdefpqr")
135+
actual (load-board board)
136+
expected [["A" "B" "C"]
137+
["D" "E" "F"]
138+
["P" "QU" "R"]]]
139+
(is (= "A B C\nD E F\nP QU R" board))
140+
(is (= expected actual)))))

0 commit comments

Comments
 (0)