Skip to content

Commit 5c98bc0

Browse files
committed
https://github.com/elixir-lang/elixir/pull/14448
1 parent 48a3e60 commit 5c98bc0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/stdlib/string_test.exs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,15 @@ defmodule StreamData.StringTest do
2525
end
2626
end
2727
end
28+
29+
if Version.match?(System.version(), "~> 1.19.0-dev") do
30+
# From https://github.com/elixir-lang/elixir/pull/14448.
31+
property "String.count_matches/2 is equivalent to String.split/1 + Kernel.length/1 - 1" do
32+
check all string <- string(:printable),
33+
pattern <- string(:printable) do
34+
assert String.count_matches(string, pattern) ==
35+
string |> String.split(pattern) |> Kernel.length() |> Kernel.-(1)
36+
end
37+
end
38+
end
2839
end

0 commit comments

Comments
 (0)