aboutsummaryrefslogtreecommitdiff
path: root/testsuite/runnable/for_each_slice.elna
blob: efdf9613569580882333e3f826e0c36d4df47c95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var
  actual: [4]Word := [4]Word{}
  input: [4]Word := [4]Word{ 2u, 4u, 6u, 8u }
  slice: []Word
  i: Word := 1u

begin
  slice := input[1u to input.length];

  for element of slice do
    actual[i] := element^ * 2u;
    i := i + 1u
  end;
  assert(actual = [4]Word{ 4u, 8u, 12u, 16u })
end.