diff options
author | Wojtek Kosior <koszko@koszko.org> | 2024-01-26 11:30:32 +0100 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2024-01-26 11:30:32 +0100 |
commit | 4343f40aa77904ff26a5425ed41211d94573002a (patch) | |
tree | d0946211cedb6f6194cef8f5b5ba7e1ec85032a5 /tests/guile | |
parent | 62f82cd792753aa5b6cd9dce9a0e723e60bbd9fd (diff) | |
download | cantius-4343f40aa77904ff26a5425ed41211d94573002a.tar.gz cantius-4343f40aa77904ff26a5425ed41211d94573002a.zip |
Add `normalize-path` function.
Diffstat (limited to 'tests/guile')
-rw-r--r-- | tests/guile/cantius-test.scm | 17 |
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"))) |