aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test/sets_SUITE.erl
diff options
context:
space:
mode:
authorj.uhlig <[email protected]>2018-03-23 14:58:18 +0100
committerj.uhlig <[email protected]>2018-03-23 14:58:18 +0100
commit3514876e3c3d774f46ccd4b0bf04bffdba3e2987 (patch)
tree325fa638e377bf918fafd372d0be931d3a699f70 /lib/stdlib/test/sets_SUITE.erl
parent9d5c485273c250b5e6d4b6c56e389c0b68ed81c7 (diff)
downloadotp-3514876e3c3d774f46ccd4b0bf04bffdba3e2987.tar.gz
otp-3514876e3c3d774f46ccd4b0bf04bffdba3e2987.tar.bz2
otp-3514876e3c3d774f46ccd4b0bf04bffdba3e2987.zip
tests for is_empty/1
Diffstat (limited to 'lib/stdlib/test/sets_SUITE.erl')
-rw-r--r--lib/stdlib/test/sets_SUITE.erl15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/stdlib/test/sets_SUITE.erl b/lib/stdlib/test/sets_SUITE.erl
index bec38000b2..7066d07e19 100644
--- a/lib/stdlib/test/sets_SUITE.erl
+++ b/lib/stdlib/test/sets_SUITE.erl
@@ -28,7 +28,7 @@
init_per_testcase/2,end_per_testcase/2,
create/1,add_element/1,del_element/1,
subtract/1,intersection/1,union/1,is_subset/1,
- is_set/1,fold/1,filter/1,
+ is_set/1,is_empty/1,fold/1,filter/1,
take_smallest/1,take_largest/1, iterate/1]).
-include_lib("common_test/include/ct.hrl").
@@ -48,7 +48,7 @@ suite() ->
all() ->
[create, add_element, del_element, subtract,
intersection, union, is_subset, is_set, fold, filter,
- take_smallest, take_largest, iterate].
+ take_smallest, take_largest, iterate, is_empty].
groups() ->
[].
@@ -345,6 +345,17 @@ is_set_1(M) ->
false = M(is_set, {}),
M(empty, []).
+is_empty(Config) when is_list(Config) ->
+ test_all(fun is_empty_1/1).
+
+is_empty_1(M) ->
+ S = M(from_list, [blurf]),
+ Empty = M(empty, []),
+
+ true = M(is_empty, Empty),
+ false = M(is_empty, S),
+ M(empty, []).
+
fold(Config) when is_list(Config) ->
test_all([{0,71},{125,129},{254,259},{510,513},{1023,1025},{9999,10001}],
fun fold_1/2).