aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/dialyzer_common.erl
diff options
context:
space:
mode:
authorStavros Aronis <[email protected]>2011-12-09 11:54:10 +0100
committerStavros Aronis <[email protected]>2012-02-22 13:04:27 +0100
commit7554fad452171ec3dc0873ffdd09a24f6531b347 (patch)
treeb298669d172117915076acbadf47ee8da06d4333 /lib/dialyzer/test/dialyzer_common.erl
parent520ddbc83ec87bcec262680bd915184182e3998e (diff)
downloadotp-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.erl11
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'.