v2 / vlib / v / tests / aliases / alias_fixed_array_init_test.v
12 lines · 10 sloc · 228 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1type Tres = [3]int
2
3fn test_alias_fixed_array_init() {
4 fixed_three := [1, 2, 3]!
5 x := Tres(fixed_three)
6 println(x)
7 assert '${x}' == 'Tres([1, 2, 3])'
8
9 y := Tres([2, 3, 4]!)
10 println(y)
11 assert '${y}' == 'Tres([2, 3, 4])'
12}
13