mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 21:40:33 +02:00
in ftw test, don't presume symlink is defined
* test-suite/tests/ftw.test (dangling symlink and lstat) (dangling symlink and stat, symlink to directory): skip if symlink undefined
This commit is contained in:
parent
130463be2a
commit
775149f0f5
1 changed files with 40 additions and 34 deletions
|
@ -253,6 +253,8 @@
|
||||||
(file-system-fold enter? leaf down up skip error '() name))))))
|
(file-system-fold enter? leaf down up skip error '() name))))))
|
||||||
|
|
||||||
(pass-if "dangling symlink and lstat"
|
(pass-if "dangling symlink and lstat"
|
||||||
|
(if (not (defined? 'symlink))
|
||||||
|
(throw 'unresolved)
|
||||||
(with-file-tree %top-builddir '(directory "test-dangling"
|
(with-file-tree %top-builddir '(directory "test-dangling"
|
||||||
(("dangling" -> "xxx")))
|
(("dangling" -> "xxx")))
|
||||||
(let ((enter? (lambda (n s r) #t))
|
(let ((enter? (lambda (n s r) #t))
|
||||||
|
@ -266,10 +268,12 @@
|
||||||
name)
|
name)
|
||||||
`((up ,name)
|
`((up ,name)
|
||||||
(leaf ,(string-append name "/dangling"))
|
(leaf ,(string-append name "/dangling"))
|
||||||
(down ,name))))))
|
(down ,name)))))))
|
||||||
|
|
||||||
(pass-if "dangling symlink and stat"
|
(pass-if "dangling symlink and stat"
|
||||||
;; Same as above, but using `stat' instead of `lstat'.
|
;; Same as above, but using `stat' instead of `lstat'.
|
||||||
|
(if (not (defined? 'symlink))
|
||||||
|
(throw 'unresolved)
|
||||||
(with-file-tree %top-builddir '(directory "test-dangling"
|
(with-file-tree %top-builddir '(directory "test-dangling"
|
||||||
(("dangling" -> "xxx")))
|
(("dangling" -> "xxx")))
|
||||||
(let ((enter? (lambda (n s r) #t))
|
(let ((enter? (lambda (n s r) #t))
|
||||||
|
@ -283,7 +287,7 @@
|
||||||
name stat)
|
name stat)
|
||||||
`((up ,name)
|
`((up ,name)
|
||||||
(error ,(string-append name "/dangling") ,ENOENT)
|
(error ,(string-append name "/dangling") ,ENOENT)
|
||||||
(down ,name)))))))
|
(down ,name))))))))
|
||||||
|
|
||||||
(with-test-prefix "file-system-tree"
|
(with-test-prefix "file-system-tree"
|
||||||
|
|
||||||
|
@ -350,12 +354,14 @@
|
||||||
;; In Guile up to 2.0.6, this would return ("." ".." "link-to-dir").
|
;; In Guile up to 2.0.6, this would return ("." ".." "link-to-dir").
|
||||||
(pass-if-equal "symlink to directory"
|
(pass-if-equal "symlink to directory"
|
||||||
'("." ".." "link-to-dir" "subdir")
|
'("." ".." "link-to-dir" "subdir")
|
||||||
|
(if (not (defined? 'symlink))
|
||||||
|
(throw 'unresolved)
|
||||||
(with-file-tree %top-builddir '(directory "test-scandir-symlink"
|
(with-file-tree %top-builddir '(directory "test-scandir-symlink"
|
||||||
(("link-to-dir" -> "subdir")
|
(("link-to-dir" -> "subdir")
|
||||||
(directory "subdir"
|
(directory "subdir"
|
||||||
(("a")))))
|
(("a")))))
|
||||||
(let ((name (string-append %top-builddir "/test-scandir-symlink")))
|
(let ((name (string-append %top-builddir "/test-scandir-symlink")))
|
||||||
(scandir name)))))
|
(scandir name))))))
|
||||||
|
|
||||||
;;; Local Variables:
|
;;; Local Variables:
|
||||||
;;; eval: (put 'with-file-tree 'scheme-indent-function 2)
|
;;; eval: (put 'with-file-tree 'scheme-indent-function 2)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue