1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/compiler/tests/if_expression_test.v
2019-11-23 14:25:57 +03:00

15 lines
271 B
V

fn test_if_expression_precedence_false_condition(){
b := 10
c := 20
res := 1 + if b > c { b } else { c } + 1
assert res == c + 2
}
fn test_if_expression_precedence_true_condition(){
b := 20
c := 10
res := 1 + if b > c { b } else { c } + 1
assert res == b + 2
}