diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-05-18 00:15:54 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-05-18 00:15:54 +0200 |
commit | bd3e62661c43d6198fb59d454e4a864726995e62 (patch) | |
tree | 358fce681b77077ee3a735894aa2bbb1e38a4851 /tests/test/util.scm | |
parent | Add check rule to makefile. (diff) | |
download | calp-bd3e62661c43d6198fb59d454e4a864726995e62.tar.gz calp-bd3e62661c43d6198fb59d454e4a864726995e62.tar.xz |
Add procedure realpath.
Diffstat (limited to 'tests/test/util.scm')
-rw-r--r-- | tests/test/util.scm | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/test/util.scm b/tests/test/util.scm index 95fa8da0..3fd926f2 100644 --- a/tests/test/util.scm +++ b/tests/test/util.scm @@ -8,8 +8,9 @@ :use-module (srfi srfi-88) :use-module (srfi srfi-1) :use-module (hnh util) + :use-module (hnh util env) :use-module ((hnh util path) - :select (path-append path-split file-hidden?))) + :select (path-append path-split file-hidden? realpath))) (test-equal "when" 1 (when #t 1)) @@ -272,3 +273,21 @@ (test-assert (file-hidden? "/path/to/.hidden")) (test-assert (not (file-hidden? "/visible/.in/hidden"))) (test-assert (not (file-hidden? ""))) + +(test-equal "Realpath for path fragment" + "/home/hugo" + (with-working-directory + "/home" + (lambda () (realpath "hugo")))) + +(test-equal "Realpath for already absolute path" + "/home/hugo" + (with-working-directory + "/tmp" + (lambda () (realpath "/home/hugo")))) + +(test-equal "Realpath for already absolute path" + "/home/hugo" + (with-working-directory + "/tmp" + (lambda () (realpath "/home/hugo")))) |