aboutsummaryrefslogtreecommitdiff
path: root/tests/value/reverse.testscript
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-09-03 16:37:32 +0200
committerKaren Arutyunov <karen@codesynthesis.com>2018-09-04 16:29:59 +0300
commit5007870b52aa549971824959a55ad3bb886f09e0 (patch)
treeb0ef7f24c0b9ece2ed23f3c1792f16da324e4171 /tests/value/reverse.testscript
parent09d60452a80d14d9b8bf3a9395860b50683fa1e8 (diff)
Rename .test/test{} to .testscript/testscript{}
Diffstat (limited to 'tests/value/reverse.testscript')
-rw-r--r--tests/value/reverse.testscript82
1 files changed, 82 insertions, 0 deletions
diff --git a/tests/value/reverse.testscript b/tests/value/reverse.testscript
new file mode 100644
index 0000000..6294d3f
--- /dev/null
+++ b/tests/value/reverse.testscript
@@ -0,0 +1,82 @@
+# file : tests/value/reverse.testscript
+# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+# Test reversal to canonical/original representation.
+#
+
+.include ../common.testscript
+
+: name
+:
+{
+ : dir
+ :
+ $* <<EOI >>EOO
+ x = s/foo/bar/
+ print ([string] $x)
+ print "$x"
+ print -e=$x
+ EOI
+ s/foo/bar/
+ s/foo/bar/
+ -e=s/foo/bar/
+ EOO
+
+ : proj
+ :
+ $* <<EOI >>EOO
+ print ([strings] foo%bar foo% %bar)
+ EOI
+ foo%bar foo% %bar
+ EOO
+
+ : pair
+ :
+ $* <<EOI >>EOO
+ print ([strings] foo@bar foo/@bar/ foo@ @bar @ "@@")
+ EOI
+ foo@bar foo/@bar/ foo@ @bar @ @@
+ EOO
+
+ : combined
+ :
+ $* <<EOI >>EOO
+ print ([strings] xx%foo@yy%bar xx%foo/@yy%bar/)
+ EOI
+ xx%foo@yy%bar xx%foo/@yy%bar/
+ EOO
+}
+
+: dir-path
+:
+{
+ : rel
+ :
+ $* <<EOI >>"EOO"
+ x = [dir_path] foo/bar/
+ print ([string] $x)
+ print "$x"
+ print "-I$x"
+ EOI
+ foo/bar/
+ foo/bar
+ -Ifoo/bar
+ EOO
+
+ : root
+ :
+ if ($cxx.target.class != 'windows')
+ {
+ $* <<EOI >>EOO
+ x = [dir_path] /
+ print ([string] $x)
+ print "$x"
+ print "-I$x"
+ EOI
+ /
+ /
+ -I/
+ EOO
+ }
+}