-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Elixir 1.14.0
Erlang/OTP 24
The sigil seems to not be working with ExUnit's assert macro when used as an argument to a function.
To reproduce:
defmodule ShorterMapsTest do
use ExUnit.Case
import ShorterMaps
test "broken" do
input = %{"name" => "myname", "age" => 123}
assert %{"input" => ^input} = ~m{input}
assert %{"input" => input} == ~m{input}
assert is_input?(input)
assert is_input?(~m{input})
end
defp is_input?(~m{input}), do: true
defp is_input?(_input), do: false
endIt gives the following error:
== Compilation error in file test/myapp/shorter_maps_test.exs ==
** (ArgumentError) interpolation is not supported with the ~m sigil
(shorter_maps 2.2.5) expanding macro: ShorterMaps.sigil_m/2
test/myapp/shorter_maps_test.exs:13: ShorterMapsTest."test broken"/1
(elixir 1.14.0) expanding macro: Kernel.if/2
test/myapp/shorter_maps_test.exs:13: ShorterMapsTest."test broken"/1
(ex_unit 1.14.0) expanding macro: ExUnit.Assertions.assert/1
test/myapp/shorter_maps_test.exs:13: ShorterMapsTest."test broken"/1
Line 13 is exactly assert is_input?(~m{input}).
This was working fine until Elixir 1.13.x, and now it's broken. I'm not sure where to start digging. :/
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels