From 3655794f0f1b0abe3629d7d7aa1f34cb6220b04f Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Tue, 22 Aug 2017 16:58:51 +0200 Subject: dialyzer (test): Do not use deprecated functions in string(3) --- lib/dialyzer/test/dialyzer_common.erl | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'lib/dialyzer') diff --git a/lib/dialyzer/test/dialyzer_common.erl b/lib/dialyzer/test/dialyzer_common.erl index 48083a2731..1a8403f486 100644 --- a/lib/dialyzer/test/dialyzer_common.erl +++ b/lib/dialyzer/test/dialyzer_common.erl @@ -221,13 +221,9 @@ get_suites(Dir) -> end. 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 create_suite(string()) -> 'ok'. -- cgit v1.2.3