diff options
author | Björn-Egil Dahlberg <[email protected]> | 2014-08-26 19:41:03 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2014-08-26 20:23:57 +0200 |
commit | f9231b8df9dafce7f7d9f6c58a55dd672126c001 (patch) | |
tree | 41a4e0b054a3db55f87f75cfdc888547d835f0db /lib/stdlib/test/erl_eval_SUITE.erl | |
parent | 5bba54e8809a59013d29b681c6fb8d863ce78ec4 (diff) | |
download | otp-f9231b8df9dafce7f7d9f6c58a55dd672126c001.tar.gz otp-f9231b8df9dafce7f7d9f6c58a55dd672126c001.tar.bz2 otp-f9231b8df9dafce7f7d9f6c58a55dd672126c001.zip |
stdlib: Update Map tests
Diffstat (limited to 'lib/stdlib/test/erl_eval_SUITE.erl')
-rw-r--r-- | lib/stdlib/test/erl_eval_SUITE.erl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/stdlib/test/erl_eval_SUITE.erl b/lib/stdlib/test/erl_eval_SUITE.erl index b55324161b..3427f431c5 100644 --- a/lib/stdlib/test/erl_eval_SUITE.erl +++ b/lib/stdlib/test/erl_eval_SUITE.erl @@ -1458,6 +1458,30 @@ eep43(Config) when is_list(Config) -> "lists:map(fun (X) -> X#{price := 0} end, [#{hello => 0, price => nil}]).", [#{hello => 0, price => 0}]), + check(fun () -> + Map = #{ <<33:333>> => "wat" }, + #{ <<33:333>> := "wat" } = Map + end, + "begin " + " Map = #{ <<33:333>> => \"wat\" }, " + " #{ <<33:333>> := \"wat\" } = Map " + "end.", + #{ <<33:333>> => "wat" }), + check(fun () -> + K1 = 1, + K2 = <<42:301>>, + K3 = {3,K2}, + Map = #{ K1 => 1, K2 => 2, K3 => 3, {2,2} => 4}, + #{ K1 := 1, K2 := 2, K3 := 3, {2,2} := 4} = Map + end, + "begin " + " K1 = 1, " + " K2 = <<42:301>>, " + " K3 = {3,K2}, " + " Map = #{ K1 => 1, K2 => 2, K3 => 3, {2,2} => 4}, " + " #{ K1 := 1, K2 := 2, K3 := 3, {2,2} := 4} = Map " + "end.", + #{ 1 => 1, <<42:301>> => 2, {3,<<42:301>>} => 3, {2,2} => 4}), error_check("[camembert]#{}.", {badarg,[camembert]}), error_check("#{} = 1.", {badmatch,1}), ok. |