[erlang-questions] False negatives in EUnit
Sun Apr 3 18:40:57 CEST 2011
Below are five EUnit tests that all pass without so much as a warning.
If you're an experienced EUnit user you will tell me that they are all
illegal tests, which they are. But is it obvious? If you are less
experienced with EUnit, or maybe just a little clumsy, or go too fast
when you refactor a test you could write something like this, and you
may never know. All it takes is that you fail to spot the missing or
To silently hide errors is the last thing I want in a testing
framework. Is there a way to fix this?
?_test(fun() -> 1 = 2 end).
[fun() -> ?_assertEqual(1, 2) end].
fun() -> ok end,
======================== EUnit ========================
[done in 0.017 s]
All 5 tests passed.
More information about the erlang-questions