aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2024-01-26 11:30:32 +0100
committerWojtek Kosior <koszko@koszko.org>2024-01-26 11:30:32 +0100
commit4343f40aa77904ff26a5425ed41211d94573002a (patch)
treed0946211cedb6f6194cef8f5b5ba7e1ec85032a5 /tests
parent62f82cd792753aa5b6cd9dce9a0e723e60bbd9fd (diff)
downloadcantius-4343f40aa77904ff26a5425ed41211d94573002a.tar.gz
cantius-4343f40aa77904ff26a5425ed41211d94573002a.zip
Add `normalize-path` function.
Diffstat (limited to 'tests')
-rw-r--r--tests/guile/cantius-test.scm17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/guile/cantius-test.scm b/tests/guile/cantius-test.scm
index 0e4b2ca..e497bfe 100644
--- a/tests/guile/cantius-test.scm
+++ b/tests/guile/cantius-test.scm
@@ -220,3 +220,20 @@
(tu:test-assert (eval '(begin (thread-terminate! server-thread)
(close server-sock))
(test-env 'nonfree-site))))
+
+(tu:test-group "normalize-path"
+ (tu:test-equal "a/b/c/d"
+ ((@ (cantius) normalize-path) "a//b/./c//c1/../d"))
+
+ (tu:test-equal "."
+ ((@ (cantius) normalize-path) "aa/bb/cc/../../.."))
+
+ (tu:test-equal "/"
+ ((@ (cantius) normalize-path) "/dd/ee/ff/../../.."))
+
+ (tu:test-equal "/../../g/h/i"
+ ((@ (cantius) normalize-path)
+ "/ignored0/../ignored1/../.././ignored2/../../g/h/i"))
+
+ (tu:test-equal "../j/k/l"
+ ((@ (cantius) normalize-path) "../j/k/l")))