aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-02-14 17:17:37 +0100
committerBjörn-Egil Dahlberg <[email protected]>2014-02-14 17:17:37 +0100
commit9f2753f13c2a9b840e76fc10a12752aaa09a7e96 (patch)
treefb0131d2748ef6911043b594721263e587eab030 /lib/stdlib/test
parent90f9fb016d199ef518737d1cd85c364a93891bd6 (diff)
parent53f50cb3729c47f337186c9d7201a62450505a3c (diff)
downloadotp-9f2753f13c2a9b840e76fc10a12752aaa09a7e96.tar.gz
otp-9f2753f13c2a9b840e76fc10a12752aaa09a7e96.tar.bz2
otp-9f2753f13c2a9b840e76fc10a12752aaa09a7e96.zip
Merge branch 'nox/maps-improve-erl_expand_records'
* nox/maps-improve-erl_expand_records: Fix expansion of records in maps
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/erl_expand_records_SUITE.erl21
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/stdlib/test/erl_expand_records_SUITE.erl b/lib/stdlib/test/erl_expand_records_SUITE.erl
index 94b4397a9c..43e679f7ed 100644
--- a/lib/stdlib/test/erl_expand_records_SUITE.erl
+++ b/lib/stdlib/test/erl_expand_records_SUITE.erl
@@ -38,7 +38,7 @@
-export([attributes/1, expr/1, guard/1,
init/1, pattern/1, strict/1, update/1,
otp_5915/1, otp_7931/1, otp_5990/1,
- otp_7078/1, otp_7101/1]).
+ otp_7078/1, otp_7101/1, maps/1]).
% Default timetrap timeout (set in init_per_testcase).
-define(default_timeout, ?t:minutes(1)).
@@ -56,7 +56,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
[attributes, expr, guard, init,
- pattern, strict, update, {group, tickets}].
+ pattern, strict, update, maps, {group, tickets}].
groups() ->
[{tickets, [],
@@ -402,7 +402,22 @@ update(Config) when is_list(Config) ->
],
?line run(Config, Ts),
ok.
-
+
+maps(Config) when is_list(Config) ->
+ Ts = [<<"-record(rr, {a,b,c}).
+ t() ->
+ R0 = id(#rr{a=1,b=2,c=3}),
+ R1 = id(#rr{a=4,b=5,c=6}),
+ [{R0,R1}] =
+ maps:to_list(#{#rr{a=1,b=2,c=3} => #rr{a=4,b=5,c=6}}),
+ #{#rr{a=1,b=2,c=3} := #rr{a=1,b=2,c=3}} =
+ #{#rr{a=1,b=2,c=3} => R1}#{#rr{a=1,b=2,c=3} := R0},
+ ok.
+
+ id(X) -> X.
+ ">>],
+ run(Config, Ts, [strict_record_tests]),
+ ok.
otp_5915(doc) ->
"Strict record tests in guards.";