Skip to content

Commit 3d7a019

Browse files
committed
Elixir: Fix negative steps
Fix the following warnings ``` warning: negative steps are not supported in String.slice/2, pass 14..-1//1 instead (elixir 1.17.3) lib/string.ex:2404: String.slice/2 test/elixir/test/uuids_test.exs:91: anonymous fn/2 in UUIDsTest."test utc_id uuids are correct"/1 (elixir 1.17.3) lib/enum.ex:2531: Enum."-reduce/2-lists^foldl/2-1-"/3 test/elixir/test/uuids_test.exs:89: UUIDsTest."test utc_id uuids are correct"/1 (ex_unit 1.17.3) lib/ex_unit/runner.ex:485: ExUnit.Runner.exec_test/2 (stdlib 4.3.1.5) timer.erl:235: :timer.tc/1 (ex_unit 1.17.3) lib/ex_unit/runner.ex:407: anonymous fn/6 in ExUnit.Runner.spawn_test_monitor/4 ``` Related PR: #5372 Related issue: #5386
1 parent 6e74d0f commit 3d7a019

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/elixir/test/uuids_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ defmodule UUIDsTest do
8888

8989
Enum.reduce(resp.body["uuids"], fn curr, acc ->
9090
assert String.length(curr) == 14 + String.length(@utc_id_suffix)
91-
assert String.slice(curr, 14..-1//-1) == @utc_id_suffix
91+
assert String.slice(curr, 14..-1//1) == @utc_id_suffix
9292
assert curr > acc
9393
curr
9494
end)

0 commit comments

Comments
 (0)