Sha256: 9b2f263dbae3eb5e3b1bc19c9f483a5b821a4af9ee0c3379642556c99aa0d598

Contents?: true

Size: 1.68 KB

Versions: 357

Compression:

Stored size: 1.68 KB

Contents

(ns minesweeper-test
  (:require [clojure.test :refer [deftest is]]
            [clojure.string :refer [join]]
            [minesweeper :refer [draw]]))

(deftest zero-size-board
  (is (= (draw "") "")))

(deftest empty-board
  (is (= (draw (join \newline ["   "
                               "   "
                               "   "]))
         (join \newline ["   "
                         "   "
                         "   "]))))

(deftest surrounded
  (is (= (draw (join \newline ["***"
                               "* *"
                               "***"]))
         (join \newline ["***"
                         "*8*"
                         "***"]))))

(deftest board-full-of-mines
  (is (= (draw (join \newline ["***"
                               "***"
                               "***"]))
         (join \newline ["***"
                         "***"
                         "***"]))))

(deftest horizontal-line
  (is (= (draw " * * ")
         "1*2*1")))

(deftest vertical-line
  (is (= (draw (join \newline [" "
                               "*"
                               " "
                               "*"
                               " "]))
         (join \newline ["1"
                         "*"
                         "2"
                         "*"
                         "1"]))))

(deftest cross
  (is (= (draw (join \newline ["  *  "
                               "  *  "
                               "*****"
                               "  *  "
                               "  *  "]))
         (join \newline [" 2*2 "
                         "25*52"
                         "*****"
                         "25*52"
                         " 2*2 "]))))

Version data entries

357 entries across 357 versions & 1 rubygems

Version Path
trackler-2.2.1.140 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.139 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.138 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.137 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.136 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.135 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.134 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.133 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.132 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.131 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.130 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.129 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.128 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.127 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.126 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.125 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.124 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.123 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.122 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.121 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj