aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-05-20 12:27:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-05-20 12:27:06 +0200
commit670393b5708e0262757da5052da9a61270c907b7 (patch)
treedf4051b52e25c0086e6c71405fa5febf0aee08b2 /tests
parentfd94c6f239d2436b6152935b4c99217129953a5d (diff)
Add $path.absolute(), $path.simple(), $path.sub_path(), $path.super_path()
Diffstat (limited to 'tests')
-rw-r--r--tests/function/path/testscript30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/function/path/testscript b/tests/function/path/testscript
index 1ed89ca..98491ea 100644
--- a/tests/function/path/testscript
+++ b/tests/function/path/testscript
@@ -80,6 +80,36 @@ s = ($posix ? '/' : '\')
}
}
+: absolute
+:
+{
+ $* <'print $absolute($src_root)' >"true" : true
+ $* <'print $path.absolute(a/b)' >"false" : false
+}
+
+: simple
+:
+{
+ $* <'print $simple([path] a)' >"true" : true
+ $* <'print $path.simple(a/b)' >"false" : false
+}
+
+: sub_path
+:
+{
+ $* <'print $sub_path($src_base, $src_root)' >"true" : true-absolute
+ $* <'print $path.sub_path(a/b/c, a/b)' >"true" : true-relative
+ $* <'print $path.sub_path(a/b/c, a/d)' >"false" : false
+}
+
+: super_path
+:
+{
+ $* <'print $super_path($src_base, true-absolute)' >"true" : true-absolute
+ $* <'print $path.super_path(a/b/c, b/c)' >"true" : true-relative
+ $* <'print $path.super_path(a/b/c, c/a)' >"false" : false
+}
+
: canonicalize
:
{