From e70a2fd034793729e10fdba707e7248270116768 Mon Sep 17 00:00:00 2001 From: Richard Carlsson Date: Mon, 18 Jul 2011 23:18:32 +0200 Subject: Updated to EUnit version 2.2.0 New macros assertNotMatch(Guard, Expr), assertNotEqual(Unexpected, Expr), and assertNotException(Class, Term, Expr). The debugMsg macro now also prints the pid of the current process. When testing all modules in a directory, tests in _tests.erl are no longer executed twice. The use of 'regexp' internally has been replaced with 're'. --- lib/eunit/src/eunit_tests.erl | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'lib/eunit/src/eunit_tests.erl') diff --git a/lib/eunit/src/eunit_tests.erl b/lib/eunit/src/eunit_tests.erl index 37c0b4d6ae..a63d102d98 100644 --- a/lib/eunit/src/eunit_tests.erl +++ b/lib/eunit/src/eunit_tests.erl @@ -26,17 +26,17 @@ -include("eunit.hrl"). -ifdef(TEST). -%% Cause all the other modules to be tested as well as this one. -full_test_() -> - %%{application, eunit}. % this currently causes a loop - %% We use the below until loop detection is implemented - [eunit_autoexport, - eunit_striptests, - eunit_server, - eunit_proc, - eunit_serial, - eunit_test, - eunit_lib, - eunit_data, - eunit_tty]. +id(X) -> X. % for suppressing compiler warnings -endif. + +under_eunit_test() -> ?assert(?UNDER_EUNIT). + +let_test() -> ?assertEqual(42, ?LET(X, 17, X+25)). + +if_test_() -> + [?_assertEqual(17, ?IF(id(1) > 0, 17, 42)), + ?_assertEqual(42, ?IF(id(1) < 0, 17, 42))]. + +matches_test_() -> + [?_assert(?MATCHES("hel"++_, "hello")), + ?_assertNot(?MATCHES("hal"++_, "hello"))]. -- cgit v1.2.3