aboutsummaryrefslogtreecommitdiffstats
path: root/lib/syntax_tools
diff options
context:
space:
mode:
authorRoland Karlsson <[email protected]>2014-04-21 13:46:18 +0200
committerRoland Karlsson <[email protected]>2014-05-09 12:13:26 +0200
commit266a12e70626d1d6119308c884c79f930bdd5bec (patch)
treed3b30e07407c7509565cbcfc9d2468fc9a34b1b6 /lib/syntax_tools
parent07b8f441ca711f9812fad9e9115bab3c3aa92f79 (diff)
downloadotp-266a12e70626d1d6119308c884c79f930bdd5bec.tar.gz
otp-266a12e70626d1d6119308c884c79f930bdd5bec.tar.bz2
otp-266a12e70626d1d6119308c884c79f930bdd5bec.zip
Add test case to syntax_tools
The added test case tests a bug when reverting maps in syntax tools.
Diffstat (limited to 'lib/syntax_tools')
-rw-r--r--lib/syntax_tools/test/syntax_tools_SUITE.erl14
1 files changed, 12 insertions, 2 deletions
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).