diff options
author | Cons T Åhs <cons@erlang.org> | 2022-03-14 15:58:31 +0100 |
---|---|---|
committer | Cons T Åhs <cons@erlang.org> | 2022-03-21 19:30:32 +0100 |
commit | 9675d26a7c96c3f4b6cf20fd608bc2384b5166ce (patch) | |
tree | 3d8f39cd8f162e9a7a2da1e21a45e425bf0eb15f /lib/syntax_tools | |
parent | 67986c3d495cf1e1c44eef2579dc9f6f04a684bb (diff) | |
download | erlang-9675d26a7c96c3f4b6cf20fd608bc2384b5166ce.tar.gz |
[features, test] Adjust tests to features implementation
* Add knowledge about new Meta chunk
* Add knowledge about new macros
* Make some tests pass in a Bad Way, by using functions that should
not be available at runtime
Co-authored-by: Lukas Larsson <garazdawi@gmail.com>
Diffstat (limited to 'lib/syntax_tools')
-rw-r--r-- | lib/syntax_tools/test/syntax_tools_SUITE.erl | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/syntax_tools/test/syntax_tools_SUITE.erl b/lib/syntax_tools/test/syntax_tools_SUITE.erl index 2ffec12740..623e79b207 100644 --- a/lib/syntax_tools/test/syntax_tools_SUITE.erl +++ b/lib/syntax_tools/test/syntax_tools_SUITE.erl @@ -412,18 +412,20 @@ test_prettypr([File|Files],DataDir,PrivDir) -> test_epp_dodger([], _, _) -> ok; test_epp_dodger([Filename|Files],DataDir,PrivDir) -> io:format("Parsing ~p~n", [Filename]), + Options = [{enable_feature, maybe_expr}], InFile = filename:join(DataDir, Filename), - Parsers = [{fun epp_dodger:parse_file/1,parse_file}, - {fun epp_dodger:quick_parse_file/1,quick_parse_file}, + Parsers = [{fun(File) -> epp_dodger:parse_file(File, Options) end,parse_file}, + {fun(File) -> epp_dodger:quick_parse_file(File, + Options) end,quick_parse_file}, {fun (File) -> {ok,Dev} = file:open(File,[read]), - Res = epp_dodger:parse(Dev), + Res = epp_dodger:parse(Dev, Options), file:close(File), Res end, parse}, {fun (File) -> {ok,Dev} = file:open(File,[read]), - Res = epp_dodger:quick_parse(Dev), + Res = epp_dodger:quick_parse(Dev, Options), file:close(File), Res end, quick_parse}], @@ -619,11 +621,7 @@ p_run_loop(Test, List, N, Refs0, Errors0) -> end. res_word_option() -> - %% FIXME: When the experimental features EEP has been implemented, we should - %% dig out all keywords defined in all features. - ResWordFun = - fun('maybe') -> true; - ('else') -> true; - (Other) -> erl_scan:reserved_word(Other) - end, + Options = [{enable_feature, maybe_expr}], + {ok, {_Ftrs, ResWordFun}} = + erl_features:keyword_fun(Options, fun erl_scan:f_reserved_word/1), {reserved_word_fun, ResWordFun}. |