Add test for failing if expression
This commit is contained in:
parent
489819a28e
commit
f02d7cb924
@ -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]
|
#[test]
|
||||||
fn parsing_block_expressions() {
|
fn parsing_block_expressions() {
|
||||||
parse_test_wrap_ast! {
|
parse_test_wrap_ast! {
|
||||||
@ -760,3 +778,4 @@ fn imports_4() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user