Skip to content

Commit

Permalink
Fix Elixir 1.17 warnings (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
whatyouhide authored Jun 12, 2024
1 parent 384e199 commit 7c70e7d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
fail-fast: false
matrix:
include:
- otp: "26.2"
elixir: "1.16"
- otp: "27.0"
elixir: "1.17"
os: ubuntu-22.04
lint: true
coverage: true
Expand Down
4 changes: 3 additions & 1 deletion lib/ex_unit_properties.ex
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@ defmodule ExUnitProperties do
defmacro property(message) do
ExUnit.plural_rule("property", "properties")

%{module: mod, file: file, line: line} = __CALLER__

quote bind_quoted: binding() do
name = ExUnit.Case.register_test(__ENV__, :property, message, [:not_implemented])
name = ExUnit.Case.register_test(mod, file, line, :property, message, [:not_implemented])
def unquote(name)(_), do: flunk("Not implemented")
end
end
Expand Down
12 changes: 6 additions & 6 deletions test/stream_data_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ defmodule StreamDataTest do
data = map(integer(1..5), &(-&1))

check all int <- data do
assert int in -1..-5
assert int in -1..-5//-1
end
end

Expand Down Expand Up @@ -97,7 +97,7 @@ defmodule StreamDataTest do
data = bind(integer(1..5), &constant(-&1))

check all int <- data do
assert int in -1..-5
assert int in -1..-5//-1
end
end

Expand Down Expand Up @@ -222,8 +222,8 @@ defmodule StreamDataTest do
end

property "one_of/1" do
check all int <- one_of([integer(1..5), integer(-1..-5)]) do
assert int in 1..5 or int in -1..-5
check all int <- one_of([integer(1..5), integer(-1..-5//-1)]) do
assert int in 1..5 or int in -1..-5//-1
end
end

Expand Down Expand Up @@ -468,9 +468,9 @@ defmodule StreamDataTest do
end

property "tuple/1" do
check all value <- tuple({integer(-1..-10), integer(1..10)}) do
check all value <- tuple({integer(-1..-10//-1), integer(1..10)}) do
assert {int1, int2} = value
assert int1 in -1..-10
assert int1 in -1..-10//-1
assert int2 in 1..10
end
end
Expand Down

0 comments on commit 7c70e7d

Please sign in to comment.