aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/parse/test.rs19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/parse/test.rs b/src/parse/test.rs
index 99b4e21..ecd5c8e 100644
--- a/src/parse/test.rs
+++ b/src/parse/test.rs
@@ -191,7 +191,24 @@ fn semicolon() {
#[test]
fn newline_separates_commands() {
- parse_test(parse(b"x \n y"), todo!());
+ parse_test(
+ parse(b"fun f { x \n y }"),
+ decl(
+ estr(b"f"),
+ block([pipes([cmd([estr(b"x")])]), pipes([cmd([estr(b"y")])])]),
+ ),
+ );
+}
+
+#[test]
+fn newline_does_not_separate_pipes() {
+ parse_test(
+ parse(b"fun f { x \n| y }"),
+ decl(
+ estr(b"f"),
+ block([pipes([cmd([estr(b"x")]), cmd([estr(b"y")])])]),
+ ),
+ );
}
#[test]