diff options
author | Henrik Nord <[email protected]> | 2011-08-30 11:28:41 +0200 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2011-08-30 11:28:41 +0200 |
commit | db333803584b17b6f281c974f8f78034be60e010 (patch) | |
tree | 380c5ebb0a684fbc7d6e6a9ffac5641428d250e3 /lib/eunit/src/eunit_server.erl | |
parent | 1a2fbf178614f752f04fd5c7499bb659293adf10 (diff) | |
parent | 25543b7f0be1b87351d616143b5d149b1aed1cea (diff) | |
download | otp-db333803584b17b6f281c974f8f78034be60e010.tar.gz otp-db333803584b17b6f281c974f8f78034be60e010.tar.bz2 otp-db333803584b17b6f281c974f8f78034be60e010.zip |
Merge branch 'dev' into major
Diffstat (limited to 'lib/eunit/src/eunit_server.erl')
-rw-r--r-- | lib/eunit/src/eunit_server.erl | 7 |
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. |