File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,43 @@ fn macro_stmt() {
9292 ) ;
9393}
9494
95+ #[ test]
96+ fn macro_items ( ) {
97+ check (
98+ TopEntryPoint :: MacroItems ,
99+ "#!/usr/bin/rust" ,
100+ expect ! [ [ r##"
101+ MACRO_ITEMS
102+ ERROR
103+ SHEBANG "#!/usr/bin/rust"
104+ error 0: expected an item
105+ "## ] ] ,
106+ ) ;
107+ check (
108+ TopEntryPoint :: MacroItems ,
109+ "struct S; foo!{}" ,
110+ expect ! [ [ r#"
111+ MACRO_ITEMS
112+ STRUCT
113+ STRUCT_KW "struct"
114+ WHITESPACE " "
115+ NAME
116+ IDENT "S"
117+ SEMICOLON ";"
118+ WHITESPACE " "
119+ MACRO_CALL
120+ PATH
121+ PATH_SEGMENT
122+ NAME_REF
123+ IDENT "foo"
124+ BANG "!"
125+ TOKEN_TREE
126+ L_CURLY "{"
127+ R_CURLY "}"
128+ "# ] ] ,
129+ ) ;
130+ }
131+
95132#[ track_caller]
96133fn check ( entry : TopEntryPoint , input : & str , expect : expect_test:: Expect ) {
97134 let ( parsed, _errors) = super :: parse ( entry, input) ;
You can’t perform that action at this time.
0 commit comments