Eunit debug macros cause tests to fail?

Hunter Kelly retnuh@REDACTED
Thu Dec 2 22:14:41 CET 2010


Hi there, I'm pretty new to Erlang and EUnit in particular, but I
thought I'd give it a shot.

I was writing a small function, using TDD with EUnit to help drive it.

Every time I put in the debugging macros, though, I get failures like this:

(emacs@REDACTED)88> foo:test().
foo:30: partition_into_test_...*failed*
::error:undef
  in function eunit:debugVal/1
    called as debugVal([1,2,6])
  in call from foo:partition_into/2
  in call from foo:'-partition_into_test_/0-fun-0-'/1


foo:32: partition_into_test_...*failed*
::error:undef
  in function eunit:debugVal/1
    called as debugVal([1,4,6])
  in call from foo:partition_into/2
  in call from foo:'-partition_into_test_/0-fun-2-'/1


foo:34: partition_into_test_...*failed*
::error:undef
  in function eunit:debugVal/1
    called as debugVal([2,0,6])
  in call from foo:partition_into/2
  in call from foo:'-partition_into_test_/0-fun-4-'/1


foo:36: partition_into_test_...*failed*
::error:undef
  in function eunit:debugVal/1
    called as debugVal([2,2,5])
  in call from foo:partition_into/2
  in call from foo:'-partition_into_test_/0-fun-6-'/1


=======================================================
  Failed: 4.  Skipped: 0.  Passed: 0.
error
(emacs@REDACTED)89>

The tests pass when I remove the debugging macros, though!  Since
io:format stuff gets swallowed, it was rather difficult figuring out
what I needed to do to make the tests pass!

Is there some misconfgiguration or something?

Erlang version:

$ erl -sname shell
Erlang R14A (erts-5.8) [source] [smp:2:2] [rq:2] [async-threads:0]
[hipe] [kernel-poll:false]

Eshell V5.8  (abort with ^G)
(shell@REDACTED)1>

I've attached the file causing the problems.

Thanks!

H
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.erl
Type: application/octet-stream
Size: 1409 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20101202/9fa7e009/attachment.obj>


More information about the erlang-questions mailing list