We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 48a3e60 commit 5c98bc0Copy full SHA for 5c98bc0
test/stdlib/string_test.exs
@@ -25,4 +25,15 @@ defmodule StreamData.StringTest do
25
end
26
27
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
38
39
0 commit comments