aboutsummaryrefslogtreecommitdiffstats
path: root/lib/eunit/src/eunit_server.erl
diff options
context:
space:
mode:
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.