diff options
author | Sverker Eriksson <sverker@erlang.org> | 2023-03-08 18:54:50 +0100 |
---|---|---|
committer | Sverker Eriksson <sverker@erlang.org> | 2023-03-08 18:54:50 +0100 |
commit | 292cecc1a2a966583c689283dde1ad4d3186fdc0 (patch) | |
tree | 187747900250c7f96394e2c825321f6704c510e2 /erts | |
parent | 2bb1e8f7da2e32b747b3713943fc18b072e30904 (diff) | |
parent | 53425fe86955b76cc236b12f28236c09e1073827 (diff) | |
download | erlang-292cecc1a2a966583c689283dde1ad4d3186fdc0.tar.gz |
Merge branch 'sverker/cuddle-map_SUITE-t_map_compare'
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/test/map_SUITE.erl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/erts/emulator/test/map_SUITE.erl b/erts/emulator/test/map_SUITE.erl index f2208fb6aa..e64311c2e5 100644 --- a/erts/emulator/test/map_SUITE.erl +++ b/erts/emulator/test/map_SUITE.erl @@ -1890,8 +1890,8 @@ cmp(M1, M2, Exact) -> cmp_maps(M1, M2, Exact) -> case {maps:size(M1),maps:size(M2)} of {S,S} -> - {K1,V1} = lists:unzip(term_sort(maps:to_list(M1))), - {K2,V2} = lists:unzip(term_sort(maps:to_list(M2))), + {K1,V1} = lists:unzip(cmp_key_sort(maps:to_list(M1))), + {K2,V2} = lists:unzip(cmp_key_sort(maps:to_list(M2))), case cmp(K1, K2, true) of 0 -> cmp(V1, V2, Exact); @@ -1915,6 +1915,10 @@ cmp_others(T1, T2, _) -> {false,false} -> 1 end. +cmp_key_sort(L) -> + lists:sort(fun(A,B) -> cmp(A,B,true) =< 0 end, + L). + map_gen(Pairs, Size) -> {_,L} = lists:foldl(fun(_, {Keys, Acc}) -> KI = rand:uniform(size(Keys)), |