aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/map_SUITE.erl
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2014-03-04 20:17:33 +0100
committerAnthony Ramine <[email protected]>2014-03-04 20:32:49 +0100
commitee03d24a84ca995a0403a385b0d808e5abce6b32 (patch)
treeb2d429333e51708100064792c2b5bdf4ab2a21fd /lib/compiler/test/map_SUITE.erl
parenta74e66a68f3b4ed590f928b4fd4f0808c6287a32 (diff)
downloadotp-ee03d24a84ca995a0403a385b0d808e5abce6b32.tar.gz
otp-ee03d24a84ca995a0403a385b0d808e5abce6b32.tar.bz2
otp-ee03d24a84ca995a0403a385b0d808e5abce6b32.zip
Properly sort map pairs in v3_codegen
Literal nil values aren't tagged tuple but the bare atom nil. The function lists:sort/2 expects the passed function to return true if the first element is less than or equal to the second, not strictly less than. The original base clause is changed accordingly. Reported-by: Ulf Norell
Diffstat (limited to 'lib/compiler/test/map_SUITE.erl')
-rw-r--r--lib/compiler/test/map_SUITE.erl3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/compiler/test/map_SUITE.erl b/lib/compiler/test/map_SUITE.erl
index b4baef461b..23c47ca5f4 100644
--- a/lib/compiler/test/map_SUITE.erl
+++ b/lib/compiler/test/map_SUITE.erl
@@ -105,6 +105,9 @@ t_build_and_match_literals(Config) when is_list(Config) ->
M = #{ map_1:=#{ map_2:=#{value_3 := third}, value_2:= second}, value_1:=first} =
id(#{ map_1=>#{ map_2=>#{value_3 => third}, value_2=> second}, value_1=>first}),
+ %% nil key
+ #{[]:=ok,1:=2} = id(#{[]=>ok,1=>2}),
+
%% error case
{'EXIT',{{badmatch,_},_}} = (catch (#{x:=3,x:=2} = id(#{x=>3}))),
{'EXIT',{{badmatch,_},_}} = (catch (#{x:=2} = id(#{x=>3}))),