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

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