Sha256: 0b68618a76488438258dff00ee5ed62bbaf4c039385282924d06279e37ed2575

Contents?: true

Size: 1.15 KB

Versions: 69

Compression:

Stored size: 1.15 KB

Contents

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

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

defmodule SpiralTest do
  use ExUnit.Case

  # @tag :pending
  test "empty spiral" do
    assert Spiral.matrix(0) == []
  end

  @tag :pending
  test "trivial spiral" do
    assert Spiral.matrix(1) == [[1]]
  end

  @tag :pending
  test "spiral of side length 2" do
    assert Spiral.matrix(2) == [
             [1, 2],
             [4, 3]
           ]
  end

  @tag :pending
  test "spiral of side length 3" do
    assert Spiral.matrix(3) == [
             [1, 2, 3],
             [8, 9, 4],
             [7, 6, 5]
           ]
  end

  @tag :pending
  test "spiral of side length 4" do
    assert Spiral.matrix(4) == [
             [1, 2, 3, 4],
             [12, 13, 14, 5],
             [11, 16, 15, 6],
             [10, 9, 8, 7]
           ]
  end

  @tag :pending
  test "spiral of size 5" do
    assert Spiral.matrix(5) == [
             [1, 2, 3, 4, 5],
             [16, 17, 18, 19, 6],
             [15, 24, 25, 20, 7],
             [14, 23, 22, 21, 8],
             [13, 12, 11, 10, 9]
           ]
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/elixir/exercises/spiral-matrix/spiral_test.exs
trackler-2.2.1.179 tracks/elixir/exercises/spiral-matrix/spiral_test.exs
trackler-2.2.1.178 tracks/elixir/exercises/spiral-matrix/spiral_test.exs
trackler-2.2.1.177 tracks/elixir/exercises/spiral-matrix/spiral_test.exs
trackler-2.2.1.176 tracks/elixir/exercises/spiral-matrix/spiral_test.exs
trackler-2.2.1.175 tracks/elixir/exercises/spiral-matrix/spiral_test.exs
trackler-2.2.1.174 tracks/elixir/exercises/spiral-matrix/spiral_test.exs
trackler-2.2.1.173 tracks/elixir/exercises/spiral-matrix/spiral_test.exs
trackler-2.2.1.172 tracks/elixir/exercises/spiral-matrix/spiral_test.exs
trackler-2.2.1.171 tracks/elixir/exercises/spiral-matrix/spiral_test.exs
trackler-2.2.1.170 tracks/elixir/exercises/spiral-matrix/spiral_test.exs
trackler-2.2.1.169 tracks/elixir/exercises/spiral-matrix/spiral_test.exs
trackler-2.2.1.167 tracks/elixir/exercises/spiral-matrix/spiral_test.exs
trackler-2.2.1.166 tracks/elixir/exercises/spiral-matrix/spiral_test.exs
trackler-2.2.1.165 tracks/elixir/exercises/spiral-matrix/spiral_test.exs
trackler-2.2.1.164 tracks/elixir/exercises/spiral-matrix/spiral_test.exs
trackler-2.2.1.163 tracks/elixir/exercises/spiral-matrix/spiral_test.exs
trackler-2.2.1.162 tracks/elixir/exercises/spiral-matrix/spiral_test.exs
trackler-2.2.1.161 tracks/elixir/exercises/spiral-matrix/spiral_test.exs
trackler-2.2.1.160 tracks/elixir/exercises/spiral-matrix/spiral_test.exs