aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-05-14 17:22:31 +0200
committerBjörn-Egil Dahlberg <[email protected]>2014-05-14 17:22:31 +0200
commite5ea301e8d8a6c0dac6c527311250e31670e7c3b (patch)
treee3b84b911e3efb60a006c33d60212ee5772ed808
parent557ac6b188521182889a6687918ca85929fd883b (diff)
parenta0cea0422fbaf6c9eb896fbb6e4f032f2546e903 (diff)
downloadotp-e5ea301e8d8a6c0dac6c527311250e31670e7c3b.tar.gz
otp-e5ea301e8d8a6c0dac6c527311250e31670e7c3b.tar.bz2
otp-e5ea301e8d8a6c0dac6c527311250e31670e7c3b.zip
Merge branch 'maint'
-rw-r--r--lib/syntax_tools/src/erl_syntax.erl4
-rw-r--r--lib/syntax_tools/test/syntax_tools_SUITE.erl14
2 files changed, 14 insertions, 4 deletions
diff --git a/lib/syntax_tools/src/erl_syntax.erl b/lib/syntax_tools/src/erl_syntax.erl
index 2576d227df..7f1e7dda31 100644
--- a/lib/syntax_tools/src/erl_syntax.erl
+++ b/lib/syntax_tools/src/erl_syntax.erl
@@ -2071,7 +2071,7 @@ map_field_assoc_value(Node) ->
{map_field_assoc, _, _, Value} ->
Value;
_ ->
- (data(Node))#map_field_assoc.name
+ (data(Node))#map_field_assoc.value
end.
@@ -2129,7 +2129,7 @@ map_field_exact_value(Node) ->
{map_field_exact, _, _, Value} ->
Value;
_ ->
- (data(Node))#map_field_exact.name
+ (data(Node))#map_field_exact.value
end.
diff --git a/lib/syntax_tools/test/syntax_tools_SUITE.erl b/lib/syntax_tools/test/syntax_tools_SUITE.erl
index d4c54a72aa..6fb3e5ccfb 100644
--- a/lib/syntax_tools/test/syntax_tools_SUITE.erl
+++ b/lib/syntax_tools/test/syntax_tools_SUITE.erl
@@ -24,12 +24,12 @@
init_per_group/2,end_per_group/2]).
%% Test cases
--export([app_test/1,appup_test/1,smoke_test/1,revert/1]).
+-export([app_test/1,appup_test/1,smoke_test/1,revert/1,revert_map/1]).
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- [app_test,appup_test,smoke_test,revert].
+ [app_test,appup_test,smoke_test,revert,revert_map].
groups() ->
[].
@@ -109,6 +109,16 @@ revert_file(File, Path) ->
ok
end.
+%% Testing bug fix for reverting map_field_assoc
+revert_map(Config) ->
+ Dog = ?t:timetrap(?t:minutes(1)),
+ ?line [{map_field_assoc,16,{atom,17,name},{var,18,'Value'}}] =
+ erl_syntax:revert_forms([{tree,map_field_assoc,
+ {attr,16,[],none},
+ {map_field_assoc,
+ {atom,17,name},{var,18,'Value'}}}]),
+ ?line ?t:timetrap_cancel(Dog).
+
p_run(Test, List) ->
N = erlang:system_info(schedulers),
p_run_loop(Test, List, N, [], 0).