aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test/sets_SUITE.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2018-03-26 08:23:18 +0200
committerGitHub <[email protected]>2018-03-26 08:23:18 +0200
commit0083a9451f5770a38bb21e78b7d574e5b72ba5f3 (patch)
tree7da02f3c3b08c3efa12be2fad6d63990a1d580e5 /lib/stdlib/test/sets_SUITE.erl
parent5c2acbd35150da5e6d3afba1f61bb8bb995bb80f (diff)
parent3514876e3c3d774f46ccd4b0bf04bffdba3e2987 (diff)
downloadotp-0083a9451f5770a38bb21e78b7d574e5b72ba5f3.tar.gz
otp-0083a9451f5770a38bb21e78b7d574e5b72ba5f3.tar.bz2
otp-0083a9451f5770a38bb21e78b7d574e5b72ba5f3.zip
Merge pull request #1703 from juhlig/master
[ERL-557] add is_empty/1 to sets and ordsets OTP-14996, ERL-557, PR-1703
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).