v2 / vlib / v / fmt / tests / fn_trailing_arg_syntax_expected.vv
50 lines · 45 sloc · 618 bytes · c51d30bf5309653c6b573ec815268e69a78ea8cc
Raw
1struct Bar {
2 x string
3 y int
4 b Baz
5}
6
7struct Baz {
8 x int
9 y int
10}
11
12fn main() {
13 bar_func(x: 'this line is short enough', y: 13)
14 bar_func(
15 x: 'a very long content should cause vfmt to use multiple lines instead of one.'
16 y: 123456789
17 )
18 bar_func(
19 x: 'some string'
20 b: Baz{
21 x: 0
22 y: 0
23 }
24 )
25 bar2_func()
26 bar2_func(Bar{ x: 's' },
27 x: 's'
28 )
29 baz_func('foo', 'bar',
30 x: 0
31 y: 0
32 )
33 ui.row(
34 // stretch: true
35 margin: Margin{
36 top: 10
37 left: 10
38 right: 10
39 bottom: 10
40 }
41 )
42}
43
44fn bar_func(bar Bar) {
45}
46
47fn bar2_func(bar1 Bar, bar2 Bar) {
48}
49
50fn baz_func(a string, b string, baz Baz) {}
51