aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/test/hipe_testsuite_driver.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2017-08-23 09:43:35 +0200
committerSiri Hansen <[email protected]>2017-09-15 17:07:52 +0200
commit5a9f3a48b2a6b58df16eb4a78d50ecd8f378bbd8 (patch)
tree4f2ad71e0a2f5202cfc3cbc9756a31c5f653eb0f /lib/hipe/test/hipe_testsuite_driver.erl
parent3655794f0f1b0abe3629d7d7aa1f34cb6220b04f (diff)
downloadotp-5a9f3a48b2a6b58df16eb4a78d50ecd8f378bbd8.tar.gz
otp-5a9f3a48b2a6b58df16eb4a78d50ecd8f378bbd8.tar.bz2
otp-5a9f3a48b2a6b58df16eb4a78d50ecd8f378bbd8.zip
hipe (test): Do not use deprecated functions in string(3)
Diffstat (limited to 'lib/hipe/test/hipe_testsuite_driver.erl')
-rw-r--r--lib/hipe/test/hipe_testsuite_driver.erl10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/hipe/test/hipe_testsuite_driver.erl b/lib/hipe/test/hipe_testsuite_driver.erl
index 88576775ca..ee9c57a908 100644
--- a/lib/hipe/test/hipe_testsuite_driver.erl
+++ b/lib/hipe/test/hipe_testsuite_driver.erl
@@ -29,13 +29,9 @@ get_suites(SuitesWithSuiteSuffix) ->
[S || {yes, S} <- Prefixes].
suffix(String, Suffix) ->
- case string:rstr(String, Suffix) of
- 0 -> no;
- Index ->
- case string:substr(String, Index) =:= Suffix of
- true -> {yes, string:sub_string(String, 1, Index-1)};
- false -> no
- end
+ case string:split(String, Suffix, trailing) of
+ [Prefix,[]] -> {yes, Prefix};
+ _ -> no
end.
-spec file_type(file:filename()) -> {ok, file_type()} | {error, ext_posix()}.