1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/compiler/tests/match_test.v

13 lines
193 B
Go
Raw Normal View History

2019-07-17 03:44:41 +03:00
fn test_match() {
2019-07-17 02:43:59 +03:00
a := 3
mut b := 0
match a {
2019-07-17 03:47:45 +03:00
2 => println('two')
3 => println('three')
b = 3
4 => println('four')
else => println('???')
2019-07-17 02:43:59 +03:00
}
assert b == 3
}