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?
You can use the
?assertEqual(Expect, Expr)macro:For more ?assert macros, check eunit docs