Skip to content

Commit

Permalink
Test parsing macro as case clause
Browse files Browse the repository at this point in the history
  • Loading branch information
gomoripeti committed Dec 21, 2023
1 parent d74db6c commit af61c4a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion apps/els_lsp/test/els_parser_macros_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
record_def_field_macro/1,
module_macro_as_record_name/1,
other_macro_as_record_name/1,
macro_guards/1
macro_guards/1,
macro_as_case_clause/1
]).

%%==============================================================================
Expand Down Expand Up @@ -241,6 +242,19 @@ macro_guards(_Config) ->
),
ok.

%% Supperted by erlfmt since erlfmt#350
macro_as_case_clause(_Config) ->
Text1 = "case X of ?M1(Y); ?M2(2) end",
?assertMatch(
[#{id := {'M1', 1}}, #{id := {'M2', 1}}],
parse_find_pois(Text1, macro)
),
?assertMatch(
[#{id := 'X'}, #{id := 'Y'}],
parse_find_pois(Text1, variable)
),
ok.

%%==============================================================================
%% Helper functions
%%==============================================================================
Expand Down

0 comments on commit af61c4a

Please sign in to comment.