v2 / vlib / v / tests / builtin_arrays / array_of_ptrs_test.v
22 lines · 21 sloc · 305 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1struct Point {
2 x int
3 y int
4}
5
6fn test_array_of_ptr_str() {
7 point_1 := &Point{1, 2}
8 point_2 := &Point{3, 4}
9 point_3 := &Point{5, 6}
10 points := [point_1, point_2, point_3]
11 assert '${points}' == '[&Point{
12 x: 1
13 y: 2
14}, &Point{
15 x: 3
16 y: 4
17}, &Point{
18 x: 5
19 y: 6
20}]
21'.trim_indent()
22}
23