aboutsummaryrefslogtreecommitdiffstats
path: root/src/parse/test.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse/test.rs')
-rw-r--r--src/parse/test.rs18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/parse/test.rs b/src/parse/test.rs
index 01dea5d..f4ac92e 100644
--- a/src/parse/test.rs
+++ b/src/parse/test.rs
@@ -235,12 +235,26 @@ fn newline_does_not_separate_pipes() {
#[test]
fn simple_if() {
- parse_test!(parse(b"if cond { x }"), todo!());
+ parse_test!(
+ parse(b"if cond { x }"),
+ cond(
+ pipes([cmd([estr(b"cond")]),]),
+ block([pipes([cmd([estr(b"x")]),])]),
+ block([])
+ )
+ );
}
#[test]
fn if_else() {
- parse_test!(parse(b"if cond { x } else { y }"), todo!());
+ parse_test!(
+ parse(b"if cond { x } else { y }"),
+ cond(
+ pipes([cmd([estr(b"cond")]),]),
+ block([pipes([cmd([estr(b"x")]),])]),
+ block([pipes([cmd([estr(b"y")]),])])
+ )
+ );
}
#[test]