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.79 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.78 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.77 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.76 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.75 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.74 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.73 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.72 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.71 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.70 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.69 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.68 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.67 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.66 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.65 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.64 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.63 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.62 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.61 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj
trackler-2.2.1.60 tracks/clojure/exercises/minesweeper/test/minesweeper_test.clj