Reputation: 5251
I am not an expert in EUnit
and I mainly use ?assert_(fun1(Args) == Result)
to test all the functions in my Erlang code (I define Result
in the _tests
module).
But in case a test fails it does not show what fun1
has actually returned.
Instead, it says something like "It should be true, but was false".
How can I make EUnit
to show in its output what fun1(Args)
has actually returned?
Upvotes: 0
Views: 241
Reputation: 2068
You can use the ?assertEqual(Expect, Expr)
macro:
?assertEqual(Result, fun1(Args))
For more ?assert macros, check eunit docs
Upvotes: 3