aboutsummaryrefslogtreecommitdiff
path: root/testsuite/runnable/slice_slice.elna
blob: d6f309fe72934f56dcb455be04f4c86f7191abb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
var
  array: [5]Int := [5]Int{ 2, 4, 6, 8, 10 }
  slice1, slice2: []Int

begin
  slice1 := array.ptr[1 to array.length];
  slice2 := slice1[2 to 4];

  assert(slice2.length = 3u);
  assert(slice2[1] = 4);
  assert(slice2[2] = 6);
  assert(slice2[3] = 8)
end.