File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -177,10 +177,10 @@ Stdout = ${ "|" ~ !"|" ~ !"&"}
177177StdoutStderr = { "|&" }
178178
179179RESERVED_WORD = _{
180- If | Then | Else | Elif | Fi | Do | Done |
180+ ( If | Then | Else | Elif | Fi | Done | Do |
181181 Case | Esac | While | Until | For |
182182 Lbrace | Rbrace | Bang | In |
183- StdoutStderr | Stdout
183+ StdoutStderr | Stdout) ~ &(WHITESPACE | NEWLINE | EOI)
184184}
185185
186186// Main grammar rules
Original file line number Diff line number Diff line change @@ -1463,6 +1463,22 @@ async fn test_set() {
14631463 . await ;
14641464}
14651465
1466+ #[ tokio:: test]
1467+ async fn test_reserved_substring ( ) {
1468+ // Test that there is no panic (prefix-dev/shell#256)
1469+ TestBuilder :: new ( )
1470+ . command ( r#"fiqwertymnbvc bla"# )
1471+ . assert_exit_code ( 127 )
1472+ . run ( )
1473+ . await ;
1474+
1475+ TestBuilder :: new ( )
1476+ . command ( r#"forplmoknib bla"# )
1477+ . assert_exit_code ( 127 )
1478+ . run ( )
1479+ . await ;
1480+ }
1481+
14661482#[ cfg( test) ]
14671483fn no_such_file_error_text ( ) -> & ' static str {
14681484 if cfg ! ( windows) {
You can’t perform that action at this time.
0 commit comments