Skip to content

Commit 2e34a5e

Browse files
committed
add empty input tests
1 parent c72908a commit 2e34a5e

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

crates/parser/src/tests/top_entries.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ fn source_file() {
5151

5252
#[test]
5353
fn macro_stmt() {
54+
check(
55+
TopEntryPoint::MacroStmts,
56+
"",
57+
expect![[r#"
58+
MACRO_STMTS
59+
"#]],
60+
);
5461
check(
5562
TopEntryPoint::MacroStmts,
5663
"#!/usr/bin/rust",
@@ -94,6 +101,13 @@ fn macro_stmt() {
94101

95102
#[test]
96103
fn macro_items() {
104+
check(
105+
TopEntryPoint::MacroItems,
106+
"",
107+
expect![[r#"
108+
MACRO_ITEMS
109+
"#]],
110+
);
97111
check(
98112
TopEntryPoint::MacroItems,
99113
"#!/usr/bin/rust",
@@ -131,6 +145,14 @@ fn macro_items() {
131145

132146
#[test]
133147
fn macro_pattern() {
148+
check(
149+
TopEntryPoint::Pattern,
150+
"",
151+
expect![[r#"
152+
ERROR
153+
error 0: expected pattern
154+
"#]],
155+
);
134156
check(
135157
TopEntryPoint::Pattern,
136158
"Some(_)",
@@ -177,6 +199,15 @@ fn macro_pattern() {
177199

178200
#[test]
179201
fn type_() {
202+
check(
203+
TopEntryPoint::Type,
204+
"",
205+
expect![[r#"
206+
ERROR
207+
error 0: expected type
208+
"#]],
209+
);
210+
180211
check(
181212
TopEntryPoint::Type,
182213
"Option<!>",
@@ -226,6 +257,14 @@ fn type_() {
226257

227258
#[test]
228259
fn expr() {
260+
check(
261+
TopEntryPoint::Expr,
262+
"",
263+
expect![[r#"
264+
ERROR
265+
error 0: expected expression
266+
"#]],
267+
);
229268
check(
230269
TopEntryPoint::Expr,
231270
"2 + 2 == 5",

0 commit comments

Comments
 (0)