From 670393b5708e0262757da5052da9a61270c907b7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 20 May 2024 12:27:06 +0200 Subject: Add $path.absolute(), $path.simple(), $path.sub_path(), $path.super_path() --- tests/function/path/testscript | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'tests') 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 : { -- cgit v1.1