1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

test-suite: Canonicalize path in test directory

* test-suite/tests/filesys.test: Canonicalize path in the chdir tests to
avoid false differences due to following links.
This commit is contained in:
Mikael Djurfeldt 2024-11-27 14:59:04 +01:00
parent 382d890026
commit 20405089de

View file

@ -423,19 +423,20 @@
(define file (search-path %load-path "ice-9/boot-9.scm"))
(pass-if-equal "test directory" (dirname file)
;; canonicalize-path is used to not stumble over differences due to links
(pass-if-equal "test directory" (canonicalize-path (dirname file))
(let ((olddir (getcwd))
(dir #f))
(chdir (dirname file))
(chdir (canonicalize-path (dirname file)))
(set! dir (getcwd))
(chdir olddir)
dir))
(pass-if-equal "test directory, via port" (dirname file)
(pass-if-equal "test directory, via port" (canonicalize-path (dirname file))
(unless (provided? 'chdir-port)
(throw 'unresolved))
(let ((olddir (getcwd))
(port (open (dirname file) O_RDONLY))
(port (open (canonicalize-path (dirname file)) O_RDONLY))
(dir #f))
(chdir port)
(set! dir (getcwd))