aboutsummaryrefslogtreecommitdiff
path: root/tests/type/set/testscript
blob: aca4c2d655df24dfbc43aa130a3340a68047228b (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
# file      : tests/type/set/testscript
# license   : MIT; see accompanying LICENSE file

# See also tests in function/*/ (size()), type/json/ (json_set).

.include ../../common.testscript

: basics
:
$* <<EOI >>EOO
s = [string_set] a b a
print $s
s += c b
print $s
s =+ d b
print $s
EOI
a b
a b c
a b c d
EOO

: type
:
$* <<EOI >>EOO
s = [string_set]
print $type($s)
EOI
string_set
EOO

: subscript
:
$* <<EOI >>EOO
s = [string_set] a b c
print ($s[b])
print ($s[z])
EOI
true
false
EOO

: iteration
:
$* <<EOI >>EOO
for s: [string_set] a b c
  print $type($s) $s

for s: [string_set, null]
  fail bad
EOI
string a
string b
string c
EOO