From 8dea55071464739bd1b8ef33ed5c294183d4780a Mon Sep 17 00:00:00 2001 From: Jonas Maier <> Date: Thu, 12 Mar 2026 08:40:55 +0100 Subject: add tests for upcoming syntax --- src/parse/test.rs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/parse') 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 -- cgit v1.2.3