aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-09-30 19:08:53 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-10-01 12:15:10 +0300
commit0e1a28e47753f2b4b4d299fa0b3c3ac80c05dc76 (patch)
tree7e575fd7c0ef1eb6a097b6f84934349ce185b2c2 /tests
parentc478a365d8479ca25f6a72d42ecd45dcb9e9569a (diff)
Add support for $string.icasecmp()
Diffstat (limited to 'tests')
-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
+ }
+}