diff options
author | Björn Gustavsson <[email protected]> | 2017-10-17 10:23:34 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-11-29 11:29:32 +0100 |
commit | c716fe6c529a749b9f9ce9716740ecb5f5363adb (patch) | |
tree | 89b589f0c4875cd6e4f78187a87a1625a30e39e7 /lib/compiler/test | |
parent | 4c8ad66bba6fad491a5d6fc34cfbf0c23b7b883a (diff) | |
download | otp-c716fe6c529a749b9f9ce9716740ecb5f5363adb.tar.gz otp-c716fe6c529a749b9f9ce9716740ecb5f5363adb.tar.bz2 otp-c716fe6c529a749b9f9ce9716740ecb5f5363adb.zip |
map_SUITE: Test for mixed map creation
Diffstat (limited to 'lib/compiler/test')
-rw-r--r-- | lib/compiler/test/map_SUITE.erl | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/compiler/test/map_SUITE.erl b/lib/compiler/test/map_SUITE.erl index b74e37fac0..6ce0dfb581 100644 --- a/lib/compiler/test/map_SUITE.erl +++ b/lib/compiler/test/map_SUITE.erl @@ -70,7 +70,10 @@ t_bad_update/1, %% new in OTP 21 - t_reused_key_variable/1 + t_reused_key_variable/1, + + %% new in OTP 22 + t_mixed_clause/1 ]). suite() -> []. @@ -124,7 +127,10 @@ all() -> t_bad_update, %% new in OTP 21 - t_reused_key_variable + t_reused_key_variable, + + %% new in OTP 22 + t_mixed_clause ]. groups() -> []. @@ -2161,6 +2167,21 @@ t_reused_key_variable(Config) when is_list(Config) -> ok end. +t_mixed_clause(_Config) -> + put(fool_inliner, x), + K = get(fool_inliner), + {42,100} = case #{K=>42,y=>100} of + #{x:=X,y:=Y} -> + {X,Y} + end, + nomatch = case #{K=>42,y=>100} of + #{x:=X,y:=0} -> + {X,Y}; + #{} -> + nomatch + end, + ok. + %% aux rand_terms(0) -> []; |