I don’t thin expected and actual make sense for elixir. With ==, IMO it is
most natural to put the expected value on the right hand side:
assert x == 5
The alternative, assert 5 == x, reads like you are asserting something
about 5.
But consider assertions with =: in that case, the expected pattern must go
on the left side, and the actual value on the right:
assert %{x: 5} = map
So I don’t think we can consistently consider one side or the other of
assertions with operators to always be “expected”.
As for left vs right: I’d be OK with that if there’s a broad consensus from
the community but prefer lhs and rhs. I don’t remember when I first learned
the lhs/rhs terminology but it wasn’t in my CS classes and I’ve seen it in
some other programming languages, too (although I forget where now: I’ve
seen this terminology often enough that it’s not notable when I see it
anymore). I also like that lhs and rhs has the same number of characters,
but left and right do not.
Myron
On Saturday, June 25, 2016 at 9:38:33 PM UTC-7, Antonio Cangiano wrote:
>
> Elixir tends to score quite well on the usability scale, however,
> displaying lhs and rhs in test results is not really user-friendly.
>
> I would suggest renaming them to more user-friendly options. Someone on
> Hacker News suggested expected and actual. Incidentally, those are the
> labels used by Clojure. Haskell (HUnit) uses expected and but got. Either
> would be clearer. It is a small improvement, but every little bit helps.
>
>
> Thoughts?
>
>
> Best,
> Antonio
>
--
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/c8ff0f17-c0ff-40c4-b1bb-e12498b19445%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.