diff options
author | Stavros Aronis <[email protected]> | 2011-12-09 11:54:10 +0100 |
---|---|---|
committer | Stavros Aronis <[email protected]> | 2012-02-22 13:04:27 +0100 |
commit | 7554fad452171ec3dc0873ffdd09a24f6531b347 (patch) | |
tree | b298669d172117915076acbadf47ee8da06d4333 /lib/dialyzer/test/dialyzer_common.erl | |
parent | 520ddbc83ec87bcec262680bd915184182e3998e (diff) | |
download | otp-7554fad452171ec3dc0873ffdd09a24f6531b347.tar.gz otp-7554fad452171ec3dc0873ffdd09a24f6531b347.tar.bz2 otp-7554fad452171ec3dc0873ffdd09a24f6531b347.zip |
Small fixes for Dialyzer's testsuites generation
Diffstat (limited to 'lib/dialyzer/test/dialyzer_common.erl')
-rw-r--r-- | lib/dialyzer/test/dialyzer_common.erl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/dialyzer/test/dialyzer_common.erl b/lib/dialyzer/test/dialyzer_common.erl index 51766a4604..d2b1026c06 100644 --- a/lib/dialyzer/test/dialyzer_common.erl +++ b/lib/dialyzer/test/dialyzer_common.erl @@ -216,10 +216,13 @@ get_suites(Dir) -> end. suffix(String, Suffix) -> - Index = string:rstr(String, Suffix), - case string:substr(String, Index) =:= Suffix of - true -> {yes, string:sub_string(String,1,Index-1)}; - false -> no + 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 end. -spec create_suite(string()) -> 'ok'. |