Sha256: 18193d14a2e6d31821dc5fda8d81f31380070d6dae7e2183530159952fe3450d

Contents?: true

Size: 1.32 KB

Versions: 69

Compression:

Stored size: 1.32 KB

Contents

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

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

defmodule StringSeriesTest do
  use ExUnit.Case

  # @tag :pending
  test "slices of size 1" do
    assert StringSeries.slices("01234", 1) == ["0", "1", "2", "3", "4"]
  end

  @tag :pending
  test "slices of size 2" do
    assert StringSeries.slices("01234", 2) == ["01", "12", "23", "34"]
  end

  @tag :pending
  test "slices of size 3" do
    assert StringSeries.slices("01234", 3) == ["012", "123", "234"]
  end

  @tag :pending
  test "slices of size 4" do
    assert StringSeries.slices("01234", 4) == ["0123", "1234"]
  end

  @tag :pending
  test "slices same size as string" do
    assert StringSeries.slices("01234", 5) == ["01234"]
  end

  @tag :pending
  test "Unicode characters count as a single character" do
    assert StringSeries.slices("José", 1) == ["J", "o", "s", "é"]
    assert StringSeries.slices("José", 2) == ["Jo", "os", "sé"]
  end

  @tag :pending
  test "slices with size longer than string return empty list" do
    assert StringSeries.slices("01234", 6) == []
  end

  @tag :pending
  test "slices with size zero or negative return empty list" do
    assert StringSeries.slices("01234", -1) == []
    assert StringSeries.slices("01234", 0) == []
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

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