aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/function/builtin/testscript10
-rw-r--r--tests/function/path/testscript17
-rw-r--r--tests/function/string/testscript8
3 files changed, 34 insertions, 1 deletions
diff --git a/tests/function/builtin/testscript b/tests/function/builtin/testscript
index 3d31ca2..3853ec2 100644
--- a/tests/function/builtin/testscript
+++ b/tests/function/builtin/testscript
@@ -77,6 +77,16 @@
$* <'print $type($identity(abc))' >'' : untyped
}
+: sort
+:
+{
+ $* <'print $sort( d/t{a} t{c b} d/t{a})' >'t{b} t{c} d/t{a} d/t{a}' : name-basics
+ $* <'print $sort( d/t{a} t{c b} d/t{a}, dedup)' >'t{b} t{c} d/t{a}' : name-dedup
+
+ $* <'print $sort([uint64s] 0 2 1 000)' >'0 0 1 2' : int-basics
+ $* <'print $sort([uint64s] 0 2 1 000, dedup)' >'0 1 2' : int-dedup
+}
+
: getenv
:
{
diff --git a/tests/function/path/testscript b/tests/function/path/testscript
index ad76513..a408ba4 100644
--- a/tests/function/path/testscript
+++ b/tests/function/path/testscript
@@ -3,7 +3,8 @@
.include ../../common.testscript
-posix = ($cxx.target.class != 'windows')
+windows = ($cxx.target.class == 'windows')
+posix = (!$windows)
s = ($posix ? '/' : '\')
@@ -104,6 +105,20 @@ if! $posix
EOO
}
+: sort
+:
+{
+ $* <'print $sort([paths] a c b a)' >'a a b c' : basics
+ $* <'print $sort([paths] a c b a, dedup)' >'a b c' : dedup
+
+ : icase
+ :
+ if $windows
+ {
+ $* <'print $sort([paths] a C B a)' >'a a B c'
+ }
+}
+
: invalid-path
:
p = ($posix ? /../foo : 'c:/../foo');
diff --git a/tests/function/string/testscript b/tests/function/string/testscript
index 9275fe5..5f80bfe 100644
--- a/tests/function/string/testscript
+++ b/tests/function/string/testscript
@@ -31,3 +31,11 @@
$* <'print $trim([string] " a ")' >'a' : string
$* <'print $string.trim( " a ")' >'a' : untyped
}
+
+: sort
+:
+{
+ $* <'print $sort([strings] a c b a)' >'a a b c' : basics
+ $* <'print $sort([strings] a c b a, dedup)' >'a b c' : dedup
+ $* <'print $sort([strings] a C B a, icase)' >'a a B C' : icase
+}