aboutsummaryrefslogtreecommitdiffstats
path: root/erts/test/z_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-08-26 09:33:26 +0200
committerBjörn Gustavsson <[email protected]>2011-10-27 12:26:50 +0200
commit14417cb51972e0116a89ab546933e2073c459bf1 (patch)
tree8e593937d000c3c5aeee643eb7d581813be915dc /erts/test/z_SUITE.erl
parent4db2084d5742e54a35da5326ea0d20eac3a3f2c5 (diff)
downloadotp-14417cb51972e0116a89ab546933e2073c459bf1.tar.gz
otp-14417cb51972e0116a89ab546933e2073c459bf1.tar.bz2
otp-14417cb51972e0116a89ab546933e2073c459bf1.zip
erts/z_SUITE: Eliminate use of deprecated regexp module
Diffstat (limited to 'erts/test/z_SUITE.erl')
-rw-r--r--erts/test/z_SUITE.erl23
1 files changed, 10 insertions, 13 deletions
diff --git a/erts/test/z_SUITE.erl b/erts/test/z_SUITE.erl
index 8fceab32a6..482ecb8fba 100644
--- a/erts/test/z_SUITE.erl
+++ b/erts/test/z_SUITE.erl
@@ -166,9 +166,12 @@ core_search_conf(RunByTS, DBTop, XDir) ->
file_inspect(#core_search_conf{file = File}, Core) ->
FRes0 = os:cmd(File ++ " " ++ Core),
- FRes = case regexp:match(FRes0, Core) of
- {match, S, E} ->
+ FRes = case string:str(FRes0, Core) of
+ 0 ->
+ FRes0;
+ S ->
L = length(FRes0),
+ E = length(Core),
case S of
1 ->
lists:sublist(FRes0, E+1, L+1);
@@ -178,19 +181,13 @@ file_inspect(#core_search_conf{file = File}, Core) ->
" "
++
lists:sublist(FRes0, E+1, L+1)
- end;
- _ -> FRes0
+ end
end,
- case regexp:match(FRes, "[Tt][Ee][Xx][Tt]") of
+ case re:run(FRes, "text|ascii", [caseless,{capture,none}]) of
+ match ->
+ not_a_core;
nomatch ->
- case regexp:match(FRes, "[Aa][Ss][Cc][Ii][Ii]") of
- nomatch ->
- probably_a_core;
- _ ->
- not_a_core
- end;
- _ ->
- not_a_core
+ probably_a_core
end.
mk_readable(F) ->