aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-03-12 17:09:13 +0100
committerBjörn-Egil Dahlberg <[email protected]>2015-03-12 17:09:13 +0100
commite0e056a62c240542decac2e2b3765a5399efae62 (patch)
treee7e098af3cfe4c3f71c8b33c5740b61be8495f58 /lib
parentbe5b000d488692b2e03c4f8318ce74712e56b7ee (diff)
parent12408cf3657a88540d7afde88e68639c72212299 (diff)
downloadotp-e0e056a62c240542decac2e2b3765a5399efae62.tar.gz
otp-e0e056a62c240542decac2e2b3765a5399efae62.tar.bz2
otp-e0e056a62c240542decac2e2b3765a5399efae62.zip
Merge branch 'nox/maps-match_specs-fixes/OTP-12270'
* nox/maps-match_specs-fixes/OTP-12270: erts: Strengthen maps match spec compilation tests Properly collect variables in match specs with maps Fix compilation of match specs with maps
Diffstat (limited to 'lib')
-rw-r--r--lib/stdlib/test/ets_SUITE.erl5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl
index 2674f6886f..72f3c49b5a 100644
--- a/lib/stdlib/test/ets_SUITE.erl
+++ b/lib/stdlib/test/ets_SUITE.erl
@@ -3779,6 +3779,7 @@ match_object_do(Opts) ->
?line ets:insert(Tab,{{one,5},5}),
?line ets:insert(Tab,{{two,4},4}),
?line ets:insert(Tab,{{two,5},6}),
+ ?line ets:insert(Tab, {#{camembert=>cabécou},7}),
?line case ets:match_object(Tab, {{one, '_'}, '$0'}) of
[{{one,5},5},{{one,4},4}] -> ok;
[{{one,4},4},{{one,5},5}] -> ok;
@@ -3799,6 +3800,10 @@ match_object_do(Opts) ->
[{{two,4},4},{{two,5},6}] -> ok;
_ -> ?t:fail("ets:match_object() returned something funny.")
end,
+ % Check that maps are inspected for variables.
+ [{#{camembert:=cabécou},7}] =
+ ets:match_object(Tab, {#{camembert=>'_'},7}),
+ {'EXIT',{badarg,_}} = (catch ets:match_object(Tab, {#{'$1'=>'_'},7})),
% Check that unsucessful match returns an empty list.
?line [] = ets:match_object(Tab, {{three,'$0'}, '$92'}),
% Check that '$0' equals '_'.