aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/error_SUITE.erl
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-02-21 11:39:07 +0100
committerBjörn-Egil Dahlberg <[email protected]>2014-02-21 11:39:07 +0100
commit2d3c60dbd941ac4408488414b6e8434405ad24a5 (patch)
tree19d6f56c13b5068ada890b8050ce6576a64d4f54 /lib/compiler/test/error_SUITE.erl
parent2b7d4bebe6d7ecf79d78ead792237a458798be5f (diff)
parent1c37990e06a4588b941f430f872ad45001b63844 (diff)
downloadotp-2d3c60dbd941ac4408488414b6e8434405ad24a5.tar.gz
otp-2d3c60dbd941ac4408488414b6e8434405ad24a5.tar.bz2
otp-2d3c60dbd941ac4408488414b6e8434405ad24a5.zip
Merge branch 'egil/compiler/maps-get_map_elements'
* egil/compiler/maps-get_map_elements: compiler: Strengthen Maps compile tests compiler: Remove dead warning erts: Fix erts_debug:disassemble/1 compiler: Transform list of Args to exact literal type compiler: Test Maps aliasing compiler: Use aliasing in map pair patterns compiler: Check literal order in beam_validator erts: Introduce new instructions for combined key fetches compiler: Change map instructions for fetching values
Diffstat (limited to 'lib/compiler/test/error_SUITE.erl')
-rw-r--r--lib/compiler/test/error_SUITE.erl19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/compiler/test/error_SUITE.erl b/lib/compiler/test/error_SUITE.erl
index 859c4571ea..5cdf429a5f 100644
--- a/lib/compiler/test/error_SUITE.erl
+++ b/lib/compiler/test/error_SUITE.erl
@@ -23,7 +23,7 @@
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2,
head_mismatch_line/1,warnings_as_errors/1, bif_clashes/1,
- transforms/1]).
+ transforms/1,forbidden_maps/1]).
%% Used by transforms/1 test case.
-export([parse_transform/2]).
@@ -36,7 +36,7 @@ all() ->
groups() ->
[{p,test_lib:parallel(),
- [head_mismatch_line,warnings_as_errors,bif_clashes,transforms]}].
+ [head_mismatch_line,warnings_as_errors,bif_clashes,transforms,forbidden_maps]}].
init_per_suite(Config) ->
Config.
@@ -240,6 +240,21 @@ parse_transform(_, _) ->
error(too_bad).
+forbidden_maps(Config) when is_list(Config) ->
+ Ts1 = [{map_illegal_use_of_pattern,
+ <<"
+ -export([t/0]).
+ t() ->
+ V = 32,
+ #{<<\"hi\",V,\"all\">> := 1} = id(#{<<\"hi all\">> => 1}).
+ id(I) -> I.
+ ">>,
+ [return],
+ {error,[{5,erl_lint,{illegal_map_key_variable,'V'}}], []}}],
+ [] = run2(Config, Ts1),
+ ok.
+
+
run(Config, Tests) ->
?line File = test_filename(Config),
run(Tests, File, dont_write_beam).