aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/map_SUITE.erl
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-03-05 18:32:31 +0100
committerBjörn-Egil Dahlberg <[email protected]>2015-03-12 19:15:32 +0100
commit494223c5e5de14c3f7a9aa8395d2d99a7faa0eca (patch)
tree75cedd87cd339d0ec0c6a0b8ac24b72b70cfbf8d /erts/emulator/test/map_SUITE.erl
parent7470adcb1255dd05cfb169929ed2dffad1f5cb32 (diff)
downloadotp-494223c5e5de14c3f7a9aa8395d2d99a7faa0eca.tar.gz
otp-494223c5e5de14c3f7a9aa8395d2d99a7faa0eca.tar.bz2
otp-494223c5e5de14c3f7a9aa8395d2d99a7faa0eca.zip
erts: Make is_members in map_SUITE's more stringent
Diffstat (limited to 'erts/emulator/test/map_SUITE.erl')
-rw-r--r--erts/emulator/test/map_SUITE.erl10
1 files changed, 7 insertions, 3 deletions
diff --git a/erts/emulator/test/map_SUITE.erl b/erts/emulator/test/map_SUITE.erl
index 1ec2484c0b..943c6f262e 100644
--- a/erts/emulator/test/map_SUITE.erl
+++ b/erts/emulator/test/map_SUITE.erl
@@ -916,9 +916,13 @@ t_bif_map_put(Config) when is_list(Config) ->
{'EXIT',{badarg,[{maps,put,_,_}|_]}} = (catch maps:put(1,a,<<>>)),
ok.
-is_members([],_) -> true;
-is_members([K|Ks],Ls) ->
- lists:member(K,Ls) andalso is_members(Ks,Ls).
+is_members(Ks,Ls) when length(Ks) =/= length(Ls) -> false;
+is_members(Ks,Ls) -> is_members_do(Ks,Ls).
+
+is_members_do([],[]) -> true;
+is_members_do([],_) -> false;
+is_members_do([K|Ks],Ls) ->
+ is_members_do(Ks, lists:delete(K,Ls)).
t_bif_map_remove(Config) when is_list(Config) ->
0 = erlang:map_size(maps:remove(some_key, #{})),