From 3c6bd65e402655aacb9dfd8e2edeb95563f3ccda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sat, 11 Feb 2023 03:27:57 +0100 Subject: Add test for path-append without components. --- module/hnh/util/path.scm | 1 + tests/test/util.scm | 2 ++ 2 files changed, 3 insertions(+) diff --git a/module/hnh/util/path.scm b/module/hnh/util/path.scm index b0991073..d22e8242 100644 --- a/module/hnh/util/path.scm +++ b/module/hnh/util/path.scm @@ -17,6 +17,7 @@ (define path-absolute? absolute-file-name?) ;; TODO remove intermidiate period components +;; e.x. /a/../b => /b (define (path-append . strings) (fold (lambda (s done) (string-append diff --git a/tests/test/util.scm b/tests/test/util.scm index ab50898a..719afbed 100644 --- a/tests/test/util.scm +++ b/tests/test/util.scm @@ -254,6 +254,8 @@ (test-equal "root" "/" (path-append "")) +(test-equal "No components" "" (path-append)) + (test-equal '("usr" "lib" "test") (path-split "usr/lib/test")) -- cgit v1.2.3