From 5697ecb492579413a7ce9589df6847a3e205c647 Mon Sep 17 00:00:00 2001 From: Jonas Maier Date: Fri, 8 May 2026 16:15:20 +0200 Subject: if parse test --- src/parse/test.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/parse/test.rs') 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] -- cgit v1.2.3