diff options
Diffstat (limited to 'v_windows/v/vlib/v/tests/aliased_array_operations_test.v')
-rw-r--r-- | v_windows/v/vlib/v/tests/aliased_array_operations_test.v | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/v_windows/v/vlib/v/tests/aliased_array_operations_test.v b/v_windows/v/vlib/v/tests/aliased_array_operations_test.v new file mode 100644 index 0000000..971ddfc --- /dev/null +++ b/v_windows/v/vlib/v/tests/aliased_array_operations_test.v @@ -0,0 +1,16 @@ +type Ints = []int + +fn test_first() { + ints := Ints([5, 10]) + assert ints.first() == 5 +} + +fn test_last() { + ints := Ints([7, 4]) + assert ints.last() == 4 +} + +fn test_index() { + ints := Ints([1, 5, 2, 3]) + assert ints[2] == 2 +} |