aboutsummaryrefslogtreecommitdiff
path: root/tests/function/string
diff options
context:
space:
mode:
Diffstat (limited to 'tests/function/string')
-rw-r--r--tests/function/string/buildfile5
-rw-r--r--tests/function/string/testscript27
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/function/string/buildfile b/tests/function/string/buildfile
new file mode 100644
index 0000000..a5de079
--- /dev/null
+++ b/tests/function/string/buildfile
@@ -0,0 +1,5 @@
+# file : tests/function/string/buildfile
+# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+./: testscript $b
diff --git a/tests/function/string/testscript b/tests/function/string/testscript
new file mode 100644
index 0000000..296e0d1
--- /dev/null
+++ b/tests/function/string/testscript
@@ -0,0 +1,27 @@
+# file : tests/function/string/testscript
+# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+.include ../../common.testscript
+
+: icasecmp
+:
+{
+ : equal
+ :
+ {
+ $* <'print $icasecmp([string] "a", [string] "A")' >'true' : string-string
+ $* <'print $icasecmp([string] "a", "A")' >'true' : string-untyped
+ $* <'print $icasecmp("a", [string] "A")' >'true' : untyped-string
+ $* <'print $string.icasecmp("a", "A")' >'true' : untyped-untyped
+ }
+
+ : different
+ :
+ {
+ $* <'print $icasecmp([string] "a", [string] "b")' >'false' : string-string
+ $* <'print $icasecmp([string] "a", "b")' >'false' : string-untyped
+ $* <'print $icasecmp("a", [string] "b")' >'false' : untyped-string
+ $* <'print $string.icasecmp("a", "b")' >'false' : untyped-untyped
+ }
+}