diff options
Diffstat (limited to 'src/parser.rs')
-rw-r--r-- | src/parser.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/parser.rs b/src/parser.rs index a11b68c..eb378ad 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -877,5 +877,17 @@ mod tests { run_pattern(":map->[:str]:str"); run_pattern(":map(->[:str]:str)()"); } + + #[test] + fn test_documented_edge_cases() { + // tests that these patterns parse successfully + fn run_pattern(mut s: &str) { + let _ = prep_parser(s).pattern(&mut s).unwrap(); + } + // Empty pattern. + run_pattern(""); + // Empty subvalue + run_pattern("()"); + } } |