diff options
| author | Jonas Maier <jonas@x77.dev> | 2026-03-18 13:49:34 +0100 |
|---|---|---|
| committer | Jonas Maier <jonas@x77.dev> | 2026-03-18 13:49:34 +0100 |
| commit | dc51bab893660979ac728636e98d24b5a36ad7fd (patch) | |
| tree | e59b8c165113dbdf916d82cb8795b1276c713106 /src/parse/test.rs | |
| parent | e4914c1d1eb703b7c3c5a27a777f42e211663298 (diff) | |
| download | pish-dc51bab893660979ac728636e98d24b5a36ad7fd.tar.gz | |
backslash to put command on multiple lines
Diffstat (limited to 'src/parse/test.rs')
| -rw-r--r-- | src/parse/test.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/parse/test.rs b/src/parse/test.rs index 3058730..91a3fda 100644 --- a/src/parse/test.rs +++ b/src/parse/test.rs @@ -329,3 +329,16 @@ fn dollar_non_var() { pipes([cmd([estr(b"echo"), estr(b"$_")]),]) ) } + +#[test] +fn backslash_eof() { + assert_eq!(do_parse(b"echo \\").unwrap_err().0, ParseError::Eof); +} + +#[test] +fn backslash_joins_lines() { + parse_test!( + parse(b"echo \\\nhello"), + pipes([cmd([estr(b"echo"), estr(b"hello")]),]) + ) +} |
