1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
Files
v/vlib/v/tests/if_expression_test.v
2020-04-12 01:41:26 +02:00

14 lines
272 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
}