aboutsummaryrefslogtreecommitdiffstats
path: root/lib/eunit/src/eunit_server.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_server.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_server.erl')
-rw-r--r--lib/eunit/src/eunit_server.erl7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/eunit/src/eunit_server.erl b/lib/eunit/src/eunit_server.erl
index bf1bb9bcef..2cdfef2668 100644
--- a/lib/eunit/src/eunit_server.erl
+++ b/lib/eunit/src/eunit_server.erl
@@ -59,8 +59,9 @@ watch(Server, Module, Opts) when is_atom(Module) ->
watch_path(Server, Path, Opts) ->
command(Server, {watch, {path, filename:flatten(Path)}, Opts}).
+%% note that the user must use $ at the end to match whole paths only
watch_regexp(Server, Regex, Opts) ->
- case regexp:parse(Regex) of
+ case re:compile(Regex,[anchored]) of
{ok, R} ->
command(Server, {watch, {regexp, R}, Opts});
{error, _}=Error ->
@@ -278,8 +279,8 @@ is_watched(Path, St) ->
match_any(sets:to_list(St#state.regexps), Path).
match_any([R | Rs], Str) ->
- case regexp:first_match(Str, R) of
- {match, _, _} -> true;
+ case re:run(Str, R, [{capture,none}]) of
+ match -> true;
_ -> match_any(Rs, Str)
end;
match_any([], _Str) -> false.