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