aboutsummaryrefslogtreecommitdiffstats
path: root/src/parse
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse')
-rw-r--r--src/parse/test.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/parse/test.rs b/src/parse/test.rs
index 9eda7d1..64cb101 100644
--- a/src/parse/test.rs
+++ b/src/parse/test.rs
@@ -169,3 +169,36 @@ fn escape_hex_1() {
fn escape_hex_2() {
parse_test(parse(b"\\x0a"), pipes([cmd([estr(b"\n")])]));
}
+
+#[test]
+fn pipe_on_new_line() {
+ parse_test(
+ parse(b"cat file \n | cat"),
+ pipes([cmd([estr(b"cat"), estr(b"file")]), cmd([estr(b"cat")])]),
+ );
+}
+
+#[test]
+fn semicolon() {
+ parse_test(parse(b"x ; y"), todo!());
+}
+
+#[test]
+fn newline_separates_commands() {
+ parse_test(parse(b"x \n y"), todo!());
+}
+
+#[test]
+fn simple_if() {
+ parse_test(parse(b"if cond { x }"), todo!());
+}
+
+#[test]
+fn if_else() {
+ parse_test(parse(b"if cond { x } else { y }"), todo!());
+}
+
+#[test]
+fn simple_while() {
+ parse_test(parse(b"while cond { x }"), todo!());
+} \ No newline at end of file