aboutsummaryrefslogtreecommitdiff
path: root/tests/function/name
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-11-03 13:08:48 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-11-04 08:09:42 +0200
commit10e634e64b5fffaf19778d8fd3aa854118aa0d53 (patch)
tree99d09d1ae6a7024b7dbc6c436bf1bc780640fe16 /tests/function/name
parente612a49ef95cf9ce3d0b5496d724f73cae9aa333 (diff)
Add $size() function to get size of sequence (names, strings, etc)
Diffstat (limited to 'tests/function/name')
-rw-r--r--tests/function/name/buildfile4
-rw-r--r--tests/function/name/testscript18
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/function/name/buildfile b/tests/function/name/buildfile
new file mode 100644
index 0000000..48be4c3
--- /dev/null
+++ b/tests/function/name/buildfile
@@ -0,0 +1,4 @@
+# file : tests/function/name/buildfile
+# license : MIT; see accompanying LICENSE file
+
+./: testscript $b
diff --git a/tests/function/name/testscript b/tests/function/name/testscript
new file mode 100644
index 0000000..2fe8e24
--- /dev/null
+++ b/tests/function/name/testscript
@@ -0,0 +1,18 @@
+# file : tests/function/name/testscript
+# license : MIT; see accompanying LICENSE file
+
+.include ../../common.testscript
+
+: size
+:
+{
+ $* <'print $size(a b c@./)' >'3' : basics
+ $* <'print $type($size(a))' >'uint64' : type
+}
+
+: sort
+:
+{
+ $* <'print $sort( d/t{a} t{c b} d/t{a})' >'t{b} t{c} d/t{a} d/t{a}' : basics
+ $* <'print $sort( d/t{a} t{c b} d/t{a}, dedup)' >'t{b} t{c} d/t{a}' : dedup
+}