aboutsummaryrefslogtreecommitdiffstats
path: root/src/parse/test.rs
diff options
context:
space:
mode:
authorJonas Maier <jonas@x77.dev>2026-03-18 13:49:34 +0100
committerJonas Maier <jonas@x77.dev>2026-03-18 13:49:34 +0100
commitdc51bab893660979ac728636e98d24b5a36ad7fd (patch)
treee59b8c165113dbdf916d82cb8795b1276c713106 /src/parse/test.rs
parente4914c1d1eb703b7c3c5a27a777f42e211663298 (diff)
downloadpish-dc51bab893660979ac728636e98d24b5a36ad7fd.tar.gz
backslash to put command on multiple lines
Diffstat (limited to 'src/parse/test.rs')
-rw-r--r--src/parse/test.rs13
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")]),])
+ )
+}