[erlang-questions] Problems with dynamically compiled eunit test

Martin Koroudjiev mrtndimitrov@REDACTED
Thu Jun 12 07:20:51 CEST 2014


I've used eunit framework many times before with no problems but now I
try to compile dynamically a test module and to run the tests. I get
this error:

*unexpected termination of test process*

  Failed: 0.  Skipped: 0.  Passed: 0.
One or more tests were cancelled.

=ERROR REPORT==== 12-Jun-2014::08:10:16 ===
Error in process <0.185.0> on node 'dilbert@REDACTED' with exit value:


The test module is the fib example from the doc page:




fib(0) -> 1;
   fib(1) -> 1;
   fib(N) when N > 1 -> fib(N-1) + fib(N-2).

fib_test_() ->
   [?_assert(fib(0) =:= 1),
    ?_assert(fib(1) =:= 1),
    ?_assert(fib(2) =:= 2),
    ?_assert(fib(3) =:= 3),
    ?_assert(fib(4) =:= 5),
    ?_assert(fib(5) =:= 8),
    ?_assertException(error, function_clause, fib(-1)),
    ?_assert(fib(31) =:= 2178309)

Does anyone know what can be wrong? Thanks in advance for your time.


More information about the erlang-questions mailing list