v2 / vlib / v / tests / aliases / aliased_array_operations_test.v
16 lines · 13 sloc · 225 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1type Ints = []int
2
3fn test_first() {
4 ints := Ints([5, 10])
5 assert ints.first() == 5
6}
7
8fn test_last() {
9 ints := Ints([7, 4])
10 assert ints.last() == 4
11}
12
13fn test_index() {
14 ints := Ints([1, 5, 2, 3])
15 assert ints[2] == 2
16}
17