diff options
author | Björn-Egil Dahlberg <[email protected]> | 2016-05-01 01:24:50 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-05-02 12:23:22 +0200 |
commit | bbb4d3f3af2ed7b836db1b038cc7d2f96794428a (patch) | |
tree | 8d86221cfbe56600dfb5d5d1264659b2b7080e8a /lib/stdlib | |
parent | e37cf7645729842cae48286805e13071632bbab0 (diff) | |
download | otp-bbb4d3f3af2ed7b836db1b038cc7d2f96794428a.tar.gz otp-bbb4d3f3af2ed7b836db1b038cc7d2f96794428a.tar.bz2 otp-bbb4d3f3af2ed7b836db1b038cc7d2f96794428a.zip |
stdlib: Strengthen map pattern tests
Diffstat (limited to 'lib/stdlib')
-rw-r--r-- | lib/stdlib/test/erl_lint_SUITE.erl | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl index 63dbc15410..b0214e5238 100644 --- a/lib/stdlib/test/erl_lint_SUITE.erl +++ b/lib/stdlib/test/erl_lint_SUITE.erl @@ -3603,6 +3603,26 @@ maps(Config) -> {errors,[{1,erl_lint,illegal_map_construction}, {1,erl_lint,{unbound_var,'X'}}], []}}, + {legal_map_pattern, + <<" + -record(mapkey, {a=1,b=2}). + t(M,K1) -> + #{ a := 1, + $a := 1, $z := 99, + #{a=>val} := 2, + K1 := 1337, + #mapkey{a = 10} := wat, + #{{a,val}=>val} := 2, + #{ \"hi\" => wazzup, hi => ho } := yep, + ok := 1.0, + [3+3] := nope, + 1.0 := yep, + {3.0+3} := nope, + {yep} := yep + } = M. + ">>, + [], + []}, {legal_map_construction, <<"t(V) -> #{ a => 1, #{a=>V} => 2, |