aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-03-24 17:46:51 +0100
committerBjörn-Egil Dahlberg <[email protected]>2014-03-24 17:46:51 +0100
commit83e37233bc4fcf5881663d5efb016f6255b496eb (patch)
tree386645a20a83671dcc8cac4d4eeff9399640b661 /lib/compiler
parent8ffbf0feccb375afc10ce676070b6b778e9bf260 (diff)
downloadotp-83e37233bc4fcf5881663d5efb016f6255b496eb.tar.gz
otp-83e37233bc4fcf5881663d5efb016f6255b496eb.tar.bz2
otp-83e37233bc4fcf5881663d5efb016f6255b496eb.zip
compiler: Cover #{ [] => Var } in testcase
Coverage removed by literals.
Diffstat (limited to 'lib/compiler')
-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.