aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/function/string/testscript3
-rw-r--r--tests/type/set/buildfile4
-rw-r--r--tests/type/set/testscript52
3 files changed, 58 insertions, 1 deletions
diff --git a/tests/function/string/testscript b/tests/function/string/testscript
index a363cc3..96f5c52 100644
--- a/tests/function/string/testscript
+++ b/tests/function/string/testscript
@@ -46,7 +46,8 @@
$* <'print $size([string] abc)' >'3' : basics
$* <'print $size([string] )' >'0' : zero
$* <'print $size([strings] a b c)' >'3' : strings
- $* <'print $size([string_map] a@1 b@2 c@3)' >'3' : string_map
+ $* <'print $size([string_set] a b b)' >'2' : string-set
+ $* <'print $size([string_map] a@1 b@2 b@3)' >'2' : string-map
}
: find
diff --git a/tests/type/set/buildfile b/tests/type/set/buildfile
new file mode 100644
index 0000000..55b37bb
--- /dev/null
+++ b/tests/type/set/buildfile
@@ -0,0 +1,4 @@
+# file : tests/type/set/buildfile
+# license : MIT; see accompanying LICENSE file
+
+./: testscript $b
diff --git a/tests/type/set/testscript b/tests/type/set/testscript
new file mode 100644
index 0000000..3897220
--- /dev/null
+++ b/tests/type/set/testscript
@@ -0,0 +1,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