Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/tests/top_entries.rs')
-rw-r--r--crates/parser/src/tests/top_entries.rs32
1 files changed, 32 insertions, 0 deletions
diff --git a/crates/parser/src/tests/top_entries.rs b/crates/parser/src/tests/top_entries.rs
index c56bf0b644..7076e03ba4 100644
--- a/crates/parser/src/tests/top_entries.rs
+++ b/crates/parser/src/tests/top_entries.rs
@@ -195,6 +195,38 @@ fn macro_pattern() {
error 0: expected pattern
"#]],
);
+
+ check(
+ TopEntryPoint::Pattern,
+ "| 42 | 43",
+ expect![[r#"
+ OR_PAT
+ PIPE "|"
+ WHITESPACE " "
+ LITERAL_PAT
+ LITERAL
+ INT_NUMBER "42"
+ WHITESPACE " "
+ PIPE "|"
+ WHITESPACE " "
+ LITERAL_PAT
+ LITERAL
+ INT_NUMBER "43"
+ "#]],
+ );
+
+ check(
+ TopEntryPoint::Pattern,
+ "| 42",
+ expect![[r#"
+ OR_PAT
+ PIPE "|"
+ WHITESPACE " "
+ LITERAL_PAT
+ LITERAL
+ INT_NUMBER "42"
+ "#]],
+ );
}
#[test]