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

# See also tests in function/*/ (size()).

.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 $s
EOI
a
b
c
EOO