diff --git a/schala-lang/language/src/parsing/test.rs b/schala-lang/language/src/parsing/test.rs index fcfadfe..39d98b7 100644 --- a/schala-lang/language/src/parsing/test.rs +++ b/schala-lang/language/src/parsing/test.rs @@ -340,6 +340,24 @@ fn parsing_bindings() { )); } +#[test] +fn parsing_if_expressions() { + parse_test_wrap_ast! { + "if x == 10 { 1 } else { 2 }", + exst!(IfExpression { + discriminator: bx! { + Discriminator::Simple(ex!(Call { f: bx!(ex!(val!("a"))), arguments: vec![]})) + }, + body: bx! { + IfExpressionBody::SimpleConditional( + vec![exst!(Call { f: bx!(ex!(val!("b"))), arguments: vec![]}), exst!(Call { f: bx!(ex!(val!("c"))), arguments: vec![] })], + None + ) + } + }) + } +} + #[test] fn parsing_block_expressions() { parse_test_wrap_ast! { @@ -760,3 +778,4 @@ fn imports_4() { }) } } +