add empty input tests

This commit is contained in:
Aleksey Kladov 2022-01-02 18:50:32 +03:00
parent c72908a201
commit 2e34a5e2e9

View File

@ -51,6 +51,13 @@ fn source_file() {
#[test] #[test]
fn macro_stmt() { fn macro_stmt() {
check(
TopEntryPoint::MacroStmts,
"",
expect![[r#"
MACRO_STMTS
"#]],
);
check( check(
TopEntryPoint::MacroStmts, TopEntryPoint::MacroStmts,
"#!/usr/bin/rust", "#!/usr/bin/rust",
@ -94,6 +101,13 @@ fn macro_stmt() {
#[test] #[test]
fn macro_items() { fn macro_items() {
check(
TopEntryPoint::MacroItems,
"",
expect![[r#"
MACRO_ITEMS
"#]],
);
check( check(
TopEntryPoint::MacroItems, TopEntryPoint::MacroItems,
"#!/usr/bin/rust", "#!/usr/bin/rust",
@ -131,6 +145,14 @@ fn macro_items() {
#[test] #[test]
fn macro_pattern() { fn macro_pattern() {
check(
TopEntryPoint::Pattern,
"",
expect![[r#"
ERROR
error 0: expected pattern
"#]],
);
check( check(
TopEntryPoint::Pattern, TopEntryPoint::Pattern,
"Some(_)", "Some(_)",
@ -177,6 +199,15 @@ fn macro_pattern() {
#[test] #[test]
fn type_() { fn type_() {
check(
TopEntryPoint::Type,
"",
expect![[r#"
ERROR
error 0: expected type
"#]],
);
check( check(
TopEntryPoint::Type, TopEntryPoint::Type,
"Option<!>", "Option<!>",
@ -226,6 +257,14 @@ fn type_() {
#[test] #[test]
fn expr() { fn expr() {
check(
TopEntryPoint::Expr,
"",
expect![[r#"
ERROR
error 0: expected expression
"#]],
);
check( check(
TopEntryPoint::Expr, TopEntryPoint::Expr,
"2 + 2 == 5", "2 + 2 == 5",