aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/warnings_SUITE.erl
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-03-25 16:57:35 +0100
committerBjörn-Egil Dahlberg <[email protected]>2014-03-25 17:43:27 +0100
commit333f03952f76ed15986eeabb9a386904521821ee (patch)
tree20c2bec9948c6ac4027709da8f9621dfbcb594ca /lib/compiler/test/warnings_SUITE.erl
parentdf6c03de9f692489d757ae1437b8fb2dc6200c6f (diff)
downloadotp-333f03952f76ed15986eeabb9a386904521821ee.tar.gz
otp-333f03952f76ed15986eeabb9a386904521821ee.tar.bz2
otp-333f03952f76ed15986eeabb9a386904521821ee.zip
compiler: Strengthen Maps warnings tests
Increases coverage.
Diffstat (limited to 'lib/compiler/test/warnings_SUITE.erl')
-rw-r--r--lib/compiler/test/warnings_SUITE.erl29
1 files changed, 28 insertions, 1 deletions
diff --git a/lib/compiler/test/warnings_SUITE.erl b/lib/compiler/test/warnings_SUITE.erl
index c3b02819f9..e8ec48df14 100644
--- a/lib/compiler/test/warnings_SUITE.erl
+++ b/lib/compiler/test/warnings_SUITE.erl
@@ -573,7 +573,34 @@ maps(Config) when is_list(Config) ->
">>,
[],
{warnings,[{3,sys_core_fold,no_clause_match},
- {9,sys_core_fold,nomatch_clause_type}]}}],
+ {9,sys_core_fold,nomatch_clause_type}]}},
+ {bad_map_src1,
+ <<"
+ t() ->
+ M = {a,[]},
+ {'EXIT',{badarg,_}} = (catch(M#{ a => 1})),
+ ok.
+ ">>,
+ [],
+ {warnings,[{4,v3_kernel,bad_map}]}},
+ {bad_map_src2,
+ <<"
+ t() ->
+ M = id({a,[]}),
+ {'EXIT',{badarg,_}} = (catch(M#{ a => 1})),
+ ok.
+ id(I) -> I.
+ ">>,
+ [inline],
+ {warnings,[{4,v3_kernel,bad_map}]}},
+ {bad_map_src3,
+ <<"
+ t() ->
+ {'EXIT',{badarg,_}} = (catch <<>>#{ a := 1}),
+ ok.
+ ">>,
+ [],
+ {warnings,[{3,v3_core,bad_map}]}}],
run(Config, Ts),
ok.