Just wanted to check before raising a PR… The Bank Account and Circular Buffer exercises in the Erlang track are using the ?assert(Expr =:= Expect)
assertion style. I think it would be better to use ?assertEqual(Expect, Expr)
because the assertion error explains what it expected vs what it got.
For example, the assertion ?assert(Amount =:= 2)
gives the error message:
**error:{assert,[{module,bank_account_tests},
{line,67},
{expression,"Amount =:= 2"},
{expected,true},
{value,false}]}
From this one, its hard to see what Amount
was. Whereas ?assertEqual(10, Amount)
gives:
**error:{assertEqual,[{module,bank_account_tests},
{line,67},
{expression,"Amount"},
{expected,2},
{value,0}]}
I’d be happy to raise a PR if there is agreement with this change.
cc @NobbZ