Sha256: 32199851810238c8254c7d9ba9c517d42c65dd12f839dfda291885e4f01bfafe

Contents?: true

Size: 1.25 KB

Versions: 326

Compression:

Stored size: 1.25 KB

Contents

if !System.get_env("EXERCISM_TEST_EXAMPLES") do
  Code.load_file("minesweeper.exs", __DIR__)
end

ExUnit.start
ExUnit.configure exclude: :pending, trace: true

defmodule MinesweeperTest do
  use ExUnit.Case

  defp clean(b), do: Enum.map(b, &String.replace(&1, ~r/[^*]/, " "))

  # @tag :pending
  test "zero size board" do
    b = []
    assert Minesweeper.annotate(clean(b)) == b
  end

  @tag :pending
  test "empty board" do
    b = ["   ",
         "   ",
         "   "]
    assert Minesweeper.annotate(clean(b)) == b
  end

  @tag :pending
  test "board full of mines" do
    b = ["***",
         "***",
         "***"]
    assert Minesweeper.annotate(clean(b)) == b
  end

  @tag :pending
  test "surrounded" do
    b = ["***",
         "*8*",
         "***"]
    assert Minesweeper.annotate(clean(b)) == b
  end

  @tag :pending
  test "horizontal line" do
    b = ["1*2*1"]
    assert Minesweeper.annotate(clean(b)) == b
  end

  @tag :pending
  test "vertical line" do
    b = ["1",
         "*",
         "2",
         "*",
         "1"]
    assert Minesweeper.annotate(clean(b)) == b
  end

  @tag :pending
  test "cross" do
    b = [" 2*2 ",
         "25*52",
         "*****",
         "25*52",
         " 2*2 "]
    assert Minesweeper.annotate(clean(b)) == b
  end
end

Version data entries

326 entries across 326 versions & 1 rubygems

Version Path
trackler-2.2.1.109 tracks/elixir/exercises/minesweeper/minesweeper_test.exs
trackler-2.2.1.108 tracks/elixir/exercises/minesweeper/minesweeper_test.exs
trackler-2.2.1.107 tracks/elixir/exercises/minesweeper/minesweeper_test.exs
trackler-2.2.1.106 tracks/elixir/exercises/minesweeper/minesweeper_test.exs
trackler-2.2.1.105 tracks/elixir/exercises/minesweeper/minesweeper_test.exs
trackler-2.2.1.104 tracks/elixir/exercises/minesweeper/minesweeper_test.exs
trackler-2.2.1.103 tracks/elixir/exercises/minesweeper/minesweeper_test.exs
trackler-2.2.1.102 tracks/elixir/exercises/minesweeper/minesweeper_test.exs
trackler-2.2.1.101 tracks/elixir/exercises/minesweeper/minesweeper_test.exs
trackler-2.2.1.100 tracks/elixir/exercises/minesweeper/minesweeper_test.exs
trackler-2.2.1.99 tracks/elixir/exercises/minesweeper/minesweeper_test.exs
trackler-2.2.1.98 tracks/elixir/exercises/minesweeper/minesweeper_test.exs
trackler-2.2.1.97 tracks/elixir/exercises/minesweeper/minesweeper_test.exs
trackler-2.2.1.96 tracks/elixir/exercises/minesweeper/minesweeper_test.exs
trackler-2.2.1.95 tracks/elixir/exercises/minesweeper/minesweeper_test.exs
trackler-2.2.1.94 tracks/elixir/exercises/minesweeper/minesweeper_test.exs
trackler-2.2.1.93 tracks/elixir/exercises/minesweeper/minesweeper_test.exs
trackler-2.2.1.92 tracks/elixir/exercises/minesweeper/minesweeper_test.exs
trackler-2.2.1.91 tracks/elixir/exercises/minesweeper/minesweeper_test.exs
trackler-2.2.1.90 tracks/elixir/exercises/minesweeper/minesweeper_test.exs