| 1 | #include "@VMODROOT/cstruct.h" |
| 2 | |
| 3 | const the_string = 'the string' |
| 4 | |
| 5 | pub struct C.Abc { |
| 6 | char_pointer_field &char |
| 7 | } |
| 8 | |
| 9 | struct VStruct { |
| 10 | a_c_struct C.Abc |
| 11 | } |
| 12 | |
| 13 | fn test_interpolation_of_v_structs_containing_c_structs() { |
| 14 | abc := C.Abc{ |
| 15 | char_pointer_field: &char(the_string.str) |
| 16 | } |
| 17 | xxx := VStruct{ |
| 18 | a_c_struct: abc |
| 19 | } |
| 20 | sxxx := xxx.str() |
| 21 | assert sxxx == 'VStruct{ |
| 22 | a_c_struct: C.Abc{ |
| 23 | char_pointer_field: &C"the string" |
| 24 | } |
| 25 | }' |
| 26 | } |
| 27 |