aboutsummaryrefslogtreecommitdiff
path: root/testsuite/runnable/for_each_slice.elna
blob: 5356bc81d44dc7cf2767e2780c0ffac0d1a3ffc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var
  actual: [4]Word := [0u, 0u, 0u, 0u]
  input: [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 = [4u, 8u, 12u, 16u])
end.