1 parent 7512df3 commit b18fe2aCopy full SHA for b18fe2a
1 file changed
test/boggle/core_test.clj
@@ -1,6 +1,7 @@
1
(ns boggle.core-test
2
(:require [clojure.test :refer :all]
3
- [boggle.core :refer :all]))
+ [boggle.core :refer :all]
4
+ [boggle.utils]))
5
6
(deftest test-valid-word?
7
(testing "valid-word?"
@@ -127,3 +128,13 @@
127
128
[["A" "B" "C"]
129
["D" "E" "F"]
130
["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