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.159 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.158 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.157 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.156 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.155 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.154 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.153 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.152 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.151 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.150 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.149 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.148 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.147 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.146 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.145 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.144 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.143 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.142 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.141 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj