elixir-lang / elixir

Elixir is a dynamic, functional language for building scalable and maintainable applications
https://elixir-lang.org/
Apache License 2.0
24.55k stars 3.38k forks source link

Cannot use ExUnit.Assertions in IEx anymore #11807

Closed wojtekmach closed 2 years ago

wojtekmach commented 2 years ago

Environment

Current behavior

Up until 1.14-dev, it was possible to do:

iex(1)> import ExUnit.Assertions; assert 1 == 2

and it printed:

** (ExUnit.AssertionError)

Assertion with == failed
code:  assert 1 == 2
left:  1
right: 2

    lib/ex_unit/assertions.ex:401: ExUnit.Assertions.assert/2

On 1.14 it fails:

warning: variable "left" does not exist and is being expanded to "left()", please use parentheses to remove the ambiguity or change the variable name
  iex

** (CompileError) iex: undefined function left/0 (there is no such import)

Expected behavior

If it is not too much hassle it would be nice to keep the old behaviour. It allows getting pretty error messages, copy-pasting assertions, etc. Feel free to close without a second thought since it was never meant to work though.

wojtekmach commented 2 years ago

Thank you! <3