aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/map_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compiler/test/map_SUITE.erl')
-rw-r--r--lib/compiler/test/map_SUITE.erl20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/compiler/test/map_SUITE.erl b/lib/compiler/test/map_SUITE.erl
index 14d175b92c..c3c4862794 100644
--- a/lib/compiler/test/map_SUITE.erl
+++ b/lib/compiler/test/map_SUITE.erl
@@ -66,7 +66,9 @@
t_export/1,
%% errors in 18
- t_register_corruption/1
+ t_register_corruption/1,
+ t_bad_update/1
+
]).
suite() -> [].
@@ -117,7 +119,8 @@ all() ->
t_export,
%% errors in 18
- t_register_corruption
+ t_register_corruption,
+ t_bad_update
].
groups() -> [].
@@ -1922,6 +1925,19 @@ validate_frequency([{T,C}|Fs],Tf) ->
validate_frequency([], _) -> ok.
+t_bad_update(_Config) ->
+ {#{0.0:=Id},#{}} = properly(#{}),
+ 42 = Id(42),
+ {'EXIT',{{badmap,_},_}} = (catch increase(0)),
+ ok.
+
+properly(Item) ->
+ {Item#{0.0 => fun id/1},Item}.
+
+increase(Allows) ->
+ catch fun() -> Allows end#{[] => +Allows, "warranty" => fun id/1}.
+
+
%% aux
rand_terms(0) -> [];