diff options
Diffstat (limited to 'lib/common_test')
-rw-r--r-- | lib/common_test/src/ct_property_test.erl | 3 | ||||
-rw-r--r-- | lib/common_test/test/property_test/ct_prop.erl | 18 |
2 files changed, 6 insertions, 15 deletions
diff --git a/lib/common_test/src/ct_property_test.erl b/lib/common_test/src/ct_property_test.erl index 47e6be30f6..251a0a4896 100644 --- a/lib/common_test/src/ct_property_test.erl +++ b/lib/common_test/src/ct_property_test.erl @@ -50,7 +50,8 @@ %%% the property tests %%% init_per_suite(Config) -> - case which_module_exists([eqc,proper,triq]) of + ToolsToCheck = proplists:get_value(prop_tools, Config, [eqc,proper,triq]), + case which_module_exists(ToolsToCheck) of {ok,ToolModule} -> case code:where_is_file(lists:concat([ToolModule,".beam"])) of non_existing -> diff --git a/lib/common_test/test/property_test/ct_prop.erl b/lib/common_test/test/property_test/ct_prop.erl index 559c33da74..67ab3f3e6b 100644 --- a/lib/common_test/test/property_test/ct_prop.erl +++ b/lib/common_test/test/property_test/ct_prop.erl @@ -8,21 +8,11 @@ prop_sort() -> is_sorted(lists:sort(UnSorted)) ). - is_sorted([]) -> true; is_sorted([_]) -> true; -is_sorted(Sorted) -> - try - lists:foldl(fun chk_sorted_pair/2, hd(Sorted), tl(Sorted)) - of - _ -> - true - catch - throw:false -> - false - end. - -chk_sorted_pair(A, B) when A>=B -> A; -chk_sorted_pair(_, _) -> throw(false). +is_sorted([H1,H2|SortedTail]) when H1 =< H2 -> + is_sorted([H2|SortedTail]); +is_sorted(_) -> + false. |