aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/runner/for.testscript
blob: 21042e59b2798be6d50e14b62351c9aacce6fc0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File      : tests/test/script/runner/for.testscript
# license   : MIT; see accompanying LICENSE file

.include ../common.testscript

: form-1
:
: for x: ...
:
{
  : basics
  :
  $c <<EOI && $b >>EOO
    for x: a b
      echo "$x" >|
    end
    EOI
    a
    b
    EOO

  : test-options
  :
  $c <<EOI && $b >>~%EOO%
    for test.options: -a -b
      echo $* >|
    end
    EOI
    %.+ -a%
    %.+ -b%
    EOO

  : special-var
  :
  $c <<EOI && $b 2>>EOE != 0
    for *: -a -b
      echo $* >|
    end
    EOI
    testscript:1:5: error: attempt to set '*' variable directly
    EOE
}