Sha256: cd5fe632ba85d59f9ec4ec99ccf8b21fc87fa914886cedd3e2bd957629f8b1a1

Contents?: true

Size: 1.04 KB

Versions: 52

Compression:

Stored size: 1.04 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

52 entries across 52 versions & 1 rubygems

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