mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
14 lines
178 B
V
14 lines
178 B
V
fn test_match_in_if_expression() {
|
|
num := 3
|
|
str := 'a'
|
|
res := if num in [1, 3] {
|
|
match str {
|
|
'a' { 'A' }
|
|
else { 'ODD' }
|
|
}
|
|
} else {
|
|
'NONE'
|
|
}
|
|
assert res == 'A'
|
|
}
|