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

filesys.test: skip copy-file EACCES test when root

Accidentally omitted from b3b7477128.

* test-suite/tests/filesys.test: skip copy-file EACCES test when root.
This commit is contained in:
Rob Browning 2025-03-20 12:44:33 -05:00
parent 4f39181b2f
commit 4527371d1b

View file

@ -62,13 +62,14 @@
(copy-file src dest) (copy-file src dest)
(pass-if-equal "copy-file dest content" msg (pass-if-equal "copy-file dest content" msg
(call-with-input-file dest get-string-all))) (call-with-input-file dest get-string-all)))
(unless (zero? (geteuid))
(with-test-prefix "read only dest" (with-test-prefix "read only dest"
(chmod dest #o444) (chmod dest #o444)
(with-exception-handler (with-exception-handler
(λ (ex) (λ (ex)
(pass-if-equal "errno is EACCES" EACCES (exception-errno ex))) (pass-if-equal "errno is EACCES" EACCES (exception-errno ex)))
(λ () (copy-file src dest)) (λ () (copy-file src dest))
#:unwind? #t))))) #:unwind? #t))))))
;; return next prospective file descriptor number ;; return next prospective file descriptor number
(define (next-fd) (define (next-fd)