diff options
author | Anthony Ramine <[email protected]> | 2014-01-31 21:44:43 +0100 |
---|---|---|
committer | Anthony Ramine <[email protected]> | 2014-02-01 03:33:23 +0100 |
commit | d96507bfc77728a5ba2a96be34f2c90178fe8a56 (patch) | |
tree | abc974502d7d9357cc5eff7af754539e32fd24f5 /lib/stdlib/test/erl_eval_SUITE.erl | |
parent | eec1d22c5aef21ad4606c79465084bbff46d42ee (diff) | |
download | otp-d96507bfc77728a5ba2a96be34f2c90178fe8a56.tar.gz otp-d96507bfc77728a5ba2a96be34f2c90178fe8a56.tar.bz2 otp-d96507bfc77728a5ba2a96be34f2c90178fe8a56.zip |
Handle map fields in their own function in erl_eval
Map fields (K := V, K => V) are not expressions and shouldn't be clauses of
erl_eval:expr/5.
Diffstat (limited to 'lib/stdlib/test/erl_eval_SUITE.erl')
-rw-r--r-- | lib/stdlib/test/erl_eval_SUITE.erl | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/stdlib/test/erl_eval_SUITE.erl b/lib/stdlib/test/erl_eval_SUITE.erl index c4b6b35e72..b194c7cb41 100644 --- a/lib/stdlib/test/erl_eval_SUITE.erl +++ b/lib/stdlib/test/erl_eval_SUITE.erl @@ -42,7 +42,8 @@ try_catch/1, eval_expr_5/1, zero_width/1, - eep37/1]). + eep37/1, + eep43/1]). %% %% Define to run outside of test server @@ -82,7 +83,7 @@ all() -> simple_cases, unary_plus, apply_atom, otp_5269, otp_6539, otp_6543, otp_6787, otp_6977, otp_7550, otp_8133, otp_10622, funs, try_catch, eval_expr_5, zero_width, - eep37]. + eep37, eep43]. groups() -> []. @@ -1424,6 +1425,20 @@ eep37(Config) when is_list(Config) -> 720), ok. +eep43(Config) when is_list(Config) -> + check(fun () -> #{} end, " #{}.", #{}), + check(fun () -> #{a => b} end, "#{a => b}.", #{a => b}), + check(fun () -> + Map = #{a => b}, + {Map#{a := b},Map#{a => c},Map#{d => e}} + end, + "begin " + " Map = #{a => B=b}, " + " {Map#{a := B},Map#{a => c},Map#{d => e}} " + "end.", + {#{a => b},#{a => c},#{a => b,d => e}}), + ok. + %% Check the string in different contexts: as is; in fun; from compiled code. check(F, String, Result) -> check1(F, String, Result), |