aboutsummaryrefslogtreecommitdiffstats
path: root/lib/eunit/src/eunit_tests.erl
diff options
context:
space:
mode:
authorRichard Carlsson <[email protected]>2011-07-18 23:18:32 +0200
committerHenrik Nord <[email protected]>2011-08-30 11:18:32 +0200
commite70a2fd034793729e10fdba707e7248270116768 (patch)
tree09c6f3316e6f453f717a923043f1f97f5591ca46 /lib/eunit/src/eunit_tests.erl
parentb0b527be0caf7750908e18d2a76a662e4887e8b8 (diff)
downloadotp-e70a2fd034793729e10fdba707e7248270116768.tar.gz
otp-e70a2fd034793729e10fdba707e7248270116768.tar.bz2
otp-e70a2fd034793729e10fdba707e7248270116768.zip
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 <Module>_tests.erl are no longer executed twice. The use of 'regexp' internally has been replaced with 're'.
Diffstat (limited to 'lib/eunit/src/eunit_tests.erl')
-rw-r--r--lib/eunit/src/eunit_tests.erl26
1 files changed, 13 insertions, 13 deletions
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"))].