v2 / vlib / v / tests / options / concat_option_test.v
21 lines · 19 sloc · 313 bytes · 8e35f4d9848f7ad35d857a187dddbfd2eca5e19d
Raw
1fn opt(arg ?int) ?int {
2 return arg
3}
4
5fn test_main() {
6 _, a, b, c, d := match 0 {
7 0 {
8 a := ?bool(true)
9 b := ?bool(none)
10 3, a, b, opt(none), opt(5)
11 }
12 else {
13 3, ?bool(false), ?bool(false), ?int(false), ?int(false)
14 }
15 }
16
17 assert a? == true
18 assert b == none
19 assert c == none
20 assert d? == 5
21}
22