diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-05-15 19:12:39 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-05-15 19:12:39 +0200 |
commit | 20e2d6380426088c21d0c7bd8211f2bee780a26c (patch) | |
tree | fd8fd8f33cb94e32a6ca5cd56d647747986a4c3e | |
parent | 2ae7b7b6c3e049aaba43c884d5c1d0c5f741cd16 (diff) | |
download | guile-20e2d6380426088c21d0c7bd8211f2bee780a26c.tar.gz |
Add more `%file-port-name-canonicalization' tests.
* test-suite/tests/ports.test ("%file-port-name-canonicalization")["relative
canonicalization with /", "relative canonicalization from ice-9",
"absolute canonicalization from ice-9"]: New tests.
-rw-r--r-- | test-suite/tests/ports.test | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test-suite/tests/ports.test b/test-suite/tests/ports.test index 07e58f655..2aec1f0b2 100644 --- a/test-suite/tests/ports.test +++ b/test-suite/tests/ports.test @@ -1110,7 +1110,25 @@ (equal? "/dev/null" (with-load-path (cons "" (delete "/" %load-path)) (with-fluids ((%file-port-name-canonicalization 'relative)) - (port-filename (open-input-file "/dev/null"))))))) + (port-filename (open-input-file "/dev/null")))))) + + (pass-if "relative canonicalization with /" + (equal? "dev/null" + (with-load-path (cons "/" %load-path) + (with-fluids ((%file-port-name-canonicalization 'relative)) + (port-filename (open-input-file "/dev/null")))))) + + (pass-if "relative canonicalization from ice-9" + (equal? "ice-9/q.scm" + (with-fluids ((%file-port-name-canonicalization 'relative)) + (port-filename + (open-input-file (%search-load-path "ice-9/q.scm")))))) + + (pass-if "absolute canonicalization from ice-9" + (equal? (string-append (assoc-ref %guile-build-info 'top_srcdir) + "/module/ice-9/q.scm") + (with-fluids ((%file-port-name-canonicalization 'absolute)) + (port-filename (open-input-file (%search-load-path "ice-9/q.scm"))))))) (delete-file (test-file)) |