> In any case, my recommendation is to always do `assert actual == expected`
> and `assert expected = actual`, never `assert expected == actual`. And yeah,
> I think you're making a good point about matching on map is definitely a
> possible foot gun, but I personally don't think it should be enforced by the
> tooling.
I do not fact that the order of the expected and actual value depends on the
used operator. I always use `assert <expected> <op> <actual>` to have some
uniformity.
However even if someone uses them in the way you pointed there, there are
examples where it failed in the wild [1]. While I can support fact that
language should not force particular style of writing code (which is funny
thing to say as `Code.format_string/{1,2}` is built in), we should help users
with informing them that they used potentially problematic form (just as we do
with `foo` vs `foo()`).
[1]: https://github.com/phoenixframework/phoenix/pull/4559/files
--
Łukasz Niemier
[email protected]
--
You received this message because you are subscribed to the Google Groups
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elixir-lang-core/593FE8D3-4281-4983-974D-F07D23E5EA1C%40niemier.pl.