mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-29 19:30:36 +02:00
fixes for chmodat test
* test-suite/tests/filesys.test (chmodat): some chmodat tests don't test if it exists. Mark unwritable file writable before deleting. ("port representing a regular file"): reorder to avoid unclosed port on exception.
This commit is contained in:
parent
c6cdd92022
commit
bb646c42f7
1 changed files with 9 additions and 2 deletions
|
@ -394,14 +394,21 @@
|
|||
(stat:perms (stat (test-file))))
|
||||
|
||||
(pass-if-exception "not a port" exception:wrong-type-arg
|
||||
(unless (defined? 'chmodat)
|
||||
(throw 'unsupported))
|
||||
(chmodat "bogus" (test-file) #o300))
|
||||
|
||||
(pass-if-exception "not a file port" exception:wrong-type-arg
|
||||
(unless (defined? 'chmodat)
|
||||
(throw 'unsupported))
|
||||
(chmodat (open-input-string "") (test-file) #o300))
|
||||
|
||||
(pass-if-exception "closed port" exception:wrong-type-arg
|
||||
(unless (defined? 'chmodat)
|
||||
(throw 'unsupported))
|
||||
(chmodat (call-with-port (open "." O_RDONLY) identity) (test-file) #o300))
|
||||
|
||||
(chmod (test-file) #o600)
|
||||
(delete-file (test-file)))
|
||||
|
||||
(with-test-prefix "chdir"
|
||||
|
@ -474,10 +481,10 @@
|
|||
(readlink '(stuff)))))
|
||||
|
||||
(pass-if-equal "port representing a regular file" EINVAL
|
||||
(unless (provided? 'readlink-port)
|
||||
(throw 'unsupported))
|
||||
(call-with-input-file (test-file)
|
||||
(lambda (port)
|
||||
(unless (provided? 'readlink-port)
|
||||
(throw 'unsupported))
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(readlink port)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue