blob: 9b3aabab14d5a78ed4fd789f79b003d7c5104f99 (
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# file : tests/type/vector/testscript
# license : MIT; see accompanying LICENSE file
# See also tests in function/*/ (size(), find(), etc).
.include ../../common.testscript
: basics
:
$* <<EOI >>EOO
v = [strings] b c
print $v
v += d
print $v
v =+ a
print $v
EOI
b c
b c d
a b c d
EOO
: type
:
$* <<EOI >>EOO
v = [strings]
print $type($v)
EOI
strings
EOO
: subscript
:
$* <<EOI >>EOO
v = [strings] a b c
print ($v[1])
print $type($v[1])
print ($v[3])
EOI
b
string
[null]
EOO
: iteration
:
$* <<EOI >>EOO
for s: [strings] a b c
print $type($s) $s
for s: [strings, null]
fail bad
EOI
string a
string b
string c
EOO
|