v2 / vlib / v / tests / options / option_last_call_test.v
16 lines · 14 sloc · 298 bytes · 42538e19ae8fa62fb4628c651f36055a037ff092
Raw
1fn test_main() {
2 assert some_func2(14)? + 'c' == 'aabcac'
3}
4
5fn some_func(i int) ?string {
6 return 'a'
7}
8
9fn some_func2(i int) ?string {
10 return match i {
11 12 { some_func(1)? + 'b' }
12 13 { some_func(1)? + 'b' + 'c' }
13 14 { 'a' + some_func(1)? + 'b' + 'c' + some_func(1)? }
14 else { none }
15 }
16}
17