aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test/sets_test_lib.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_test_lib.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_test_lib.erl')
-rw-r--r--lib/stdlib/test/sets_test_lib.erl13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/stdlib/test/sets_test_lib.erl b/lib/stdlib/test/sets_test_lib.erl
index 9f153822a2..93d027704b 100644
--- a/lib/stdlib/test/sets_test_lib.erl
+++ b/lib/stdlib/test/sets_test_lib.erl
@@ -32,7 +32,7 @@ new(Mod, Eq) ->
(from_list, L) -> Mod:from_list(L);
(intersection, {S1,S2}) -> intersection(Mod, Eq, S1, S2);
(intersection, Ss) -> intersection(Mod, Eq, Ss);
- (is_empty, S) -> is_empty(Mod, S);
+ (is_empty, S) -> Mod:is_empty(S);
(is_set, S) -> Mod:is_set(S);
(is_subset, {S,Set}) -> is_subset(Mod, Eq, S, Set);
(iterator, S) -> Mod:iterator(S);
@@ -56,7 +56,7 @@ singleton(Mod, E) ->
add_element(Mod, El, S0) ->
S = Mod:add_element(El, S0),
true = Mod:is_element(El, S),
- false = is_empty(Mod, S),
+ false = Mod:is_empty(S),
true = Mod:is_set(S),
S.
@@ -66,17 +66,10 @@ del_element(Mod, El, S0) ->
true = Mod:is_set(S),
S.
-is_empty(Mod, S) ->
- true = Mod:is_set(S),
- case erlang:function_exported(Mod, is_empty, 1) of
- true -> Mod:is_empty(S);
- false -> Mod:size(S) == 0
- end.
-
intersection(Mod, Equal, S1, S2) ->
S = Mod:intersection(S1, S2),
true = Equal(S, Mod:intersection(S2, S1)),
- Disjoint = is_empty(Mod, S),
+ Disjoint = Mod:is_empty(S),
Disjoint = Mod:is_disjoint(S1, S2),
Disjoint = Mod:is_disjoint(S2, S1),
S.