Whence eunit:test/0?

Brujo Benavides elbrujohalcon@REDACTED
Fri Nov 15 21:29:39 CET 2019


It’s the magic of parse transforms!

eunit.erl includes eunit.hrl: https://github.com/erlang/otp/blob/8e4abc44d58e61753716e63b23c6b44d221feb15/lib/eunit/src/eunit.erl#L30 <https://github.com/erlang/otp/blob/8e4abc44d58e61753716e63b23c6b44d221feb15/lib/eunit/src/eunit.erl#L30>

When you include that header file, it will create a test/0 function for you.
Check it out: http://erlang.org/doc/apps/eunit/chapter.html#running-eunit <http://erlang.org/doc/apps/eunit/chapter.html#running-eunit>

Brujo Benavides <http://about.me/elbrujohalcon>



> On 15 Nov 2019, at 17:24, Roger Lipscombe <roger@REDACTED> wrote:
> 
> 1> eunit:test().
>  All 6 tests passed.
> ok
> 
> But there's no `test/0` function *in* eunit.erl. What's going on?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20191115/7c5968ce/attachment.htm>


More information about the erlang-questions mailing list