From 7c70e7d5d1e83cbe54136dd3bb9447d3b4ae8083 Mon Sep 17 00:00:00 2001 From: Andrea Leopardi Date: Wed, 12 Jun 2024 19:53:23 +0900 Subject: [PATCH] Fix Elixir 1.17 warnings (#196) --- .github/workflows/main.yml | 4 ++-- lib/ex_unit_properties.ex | 4 +++- test/stream_data_test.exs | 12 ++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fecc34d..d32d5cb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/lib/ex_unit_properties.ex b/lib/ex_unit_properties.ex index 67e8777..4d95123 100644 --- a/lib/ex_unit_properties.ex +++ b/lib/ex_unit_properties.ex @@ -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 diff --git a/test/stream_data_test.exs b/test/stream_data_test.exs index b175092..e677964 100644 --- a/test/stream_data_test.exs +++ b/test/stream_data_test.exs @@ -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 @@ -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 @@ -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 @@ -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