Search code examples
erlangtestcase

Erlang test cases manual fail


What is the best way to manually make a test case fail in Erlang common test? I am using something like this:

ok = nok, % fail as soon as possible

to raise a badmatch exception and make the case fail. I wonder if there are other (better) ways to achieve this?


Solution

  • ct:fail/1 and ct:fail/2 seem to be there for that reason.