summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test-suite/tests/ports.test20
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))