v2 / vlib / v / tests / structs / struct_init_with_complex_fields_test.v
21 lines · 17 sloc · 281 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1struct Bar {}
2
3type Fnc = fn ()
4
5struct Foo {
6 Bar
7 fnc_fn Fnc = unsafe { nil }
8}
9
10struct App {
11mut:
12 foo Foo
13}
14
15fn test_struct_init_with_complex_fields() {
16 mut app := App{}
17 println(app)
18 ret := '${app}'
19 assert ret.contains('Bar: Bar{}')
20 assert ret.contains('fnc_fn: fn ()')
21}
22