It does not work for me:
iex(1)> defmodule X do
...(1)> def indentity(x), do: x
...(1)> end
{:module, X,
<<70, 79, 82, 49, 0, 0, 4, 212, 66, 69, 65, 77, 65, 116, 85, 56, 0, 0, 0, 137,
0, 0, 0, 14, 8, 69, 108, 105, 120, 105, 114, 46, 88, 8, 95, 95, 105, 110,
102, 111, 95, 95, 10, 97, 116, 116, 114, ...>>, {:indentity, 1}}
iex(2)> require ExUnit.Assertions
ExUnit.Assertions
iex(3)> ExUnit.Assertions.assert X.identity(1) = 1
** (CompileError) iex:3: cannot invoke remote function X.identity/1 inside a match
(stdlib 3.14) lists.erl:1358: :lists.mapfoldl/3
(stdlib 3.14) lists.erl:1358: :lists.mapfoldl/3
expanding macro: ExUnit.Assertions.assert/1
To be more precise, I know you can assert with a valid match expression, but that’s it. No left-side function calls (same rules as for case, receive).






















