diff options
author | Björn Gustavsson <[email protected]> | 2011-08-26 09:33:26 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2011-10-27 12:26:50 +0200 |
commit | 14417cb51972e0116a89ab546933e2073c459bf1 (patch) | |
tree | 8e593937d000c3c5aeee643eb7d581813be915dc | |
parent | 4db2084d5742e54a35da5326ea0d20eac3a3f2c5 (diff) | |
download | otp-14417cb51972e0116a89ab546933e2073c459bf1.tar.gz otp-14417cb51972e0116a89ab546933e2073c459bf1.tar.bz2 otp-14417cb51972e0116a89ab546933e2073c459bf1.zip |
erts/z_SUITE: Eliminate use of deprecated regexp module
-rw-r--r-- | erts/test/z_SUITE.erl | 23 |
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) -> |