From 4343f40aa77904ff26a5425ed41211d94573002a Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Fri, 26 Jan 2024 11:30:32 +0100 Subject: Add `normalize-path` function. --- tests/guile/cantius-test.scm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') 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"))) -- cgit v1.2.3