[erlang-questions] Eunit debug macros cause tests to fail?

Hunter Kelly retnuh@REDACTED
Thu Dec 2 22:33:56 CET 2010


Yes, that was it, of course!  D'oh!

H

On Thu, Dec 2, 2010 at 9:32 PM, Fernando Benavides <
fernando.benavides@REDACTED> wrote:

>  Hi Hunter,
>
>  I didn't try your code, but seems like you need to use *?debugVal*([1,2,6])
> instead of *eunit:debugVal*([1,2,6]).
> You should try that :)
>
> Cheers!
>
>
> On Thu, 2010-12-02 at 21:14 +0000, Hunter Kelly wrote:
>
>
> 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
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED <erlang-questions-unsubscribe@REDACTED>
>
>
>   ------------------------------
>
> *Fernando Benavides <http://google.com/profiles/greenmellon>*
>
> *fernando@REDACTED*
>


More information about the erlang-questions mailing list