aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/compiler/test/map_SUITE.erl16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/compiler/test/map_SUITE.erl b/lib/compiler/test/map_SUITE.erl
index 90eae6fb4f..fe6273b8ac 100644
--- a/lib/compiler/test/map_SUITE.erl
+++ b/lib/compiler/test/map_SUITE.erl
@@ -40,6 +40,7 @@
t_build_and_match_over_alloc/1,
t_build_and_match_empty_val/1,
t_build_and_match_val/1,
+ t_build_and_match_nil/1,
%% errors in 17.0-rc1
t_update_values/1,
@@ -68,6 +69,7 @@ all() -> [
t_build_and_match_over_alloc,
t_build_and_match_empty_val,
t_build_and_match_val,
+ t_build_and_match_nil,
%% errors in 17.0-rc1
t_update_values,
@@ -561,6 +563,20 @@ t_build_and_match_val(Config) when is_list(Config) ->
test_server:fail({no_match, Other})
end.
+t_build_and_match_nil(Config) when is_list(Config) ->
+ %% literals removed the coverage
+ V1 = id(cookie),
+ V2 = id(cake),
+ V3 = id(crisps),
+
+ #{ [] := V1, "treat" := V2, {your,treat} := V3 } = id(#{
+ {your,treat} => V3,
+ "treat" => V2,
+ [] => V1 }),
+ #{ [] := V3, [] := V3 } = id(#{ [] => V1, [] => V3 }),
+
+ ok.
+
%% Use this function to avoid compile-time evaluation of an expression.
id(I) -> I.