Sha256: b9bb34aaef011d9a508725e11b6640a38cedfee5fb40d1e0cadd6ceabff4e3e0
Contents?: true
Size: 1.8 KB
Versions: 39
Compression:
Stored size: 1.8 KB
Contents
(ns minesweeper-test (:require [clojure.test :refer [deftest is]] [clojure.string :refer [join]] [minesweeper :refer [draw]])) (def line-separator (System/getProperty "line.separator")) (deftest zero-size-board (is (= (draw "") ""))) (deftest empty-board (is (= (draw (join line-separator [" " " " " "])) (join line-separator [" " " " " "])))) (deftest surrounded (is (= (draw (join line-separator ["***" "* *" "***"])) (join line-separator ["***" "*8*" "***"])))) (deftest board-full-of-mines (is (= (draw (join line-separator ["***" "***" "***"])) (join line-separator ["***" "***" "***"])))) (deftest horizontal-line (is (= (draw " * * ") "1*2*1"))) (deftest vertical-line (is (= (draw (join line-separator [" " "*" " " "*" " "])) (join line-separator ["1" "*" "2" "*" "1"])))) (deftest cross (is (= (draw (join line-separator [" * " " * " "*****" " * " " * "])) (join line-separator [" 2*2 " "25*52" "*****" "25*52" " 2*2 "]))))
Version data entries
39 entries across 39 versions & 1 rubygems