diff options
author | Michael Gran <spk121@yahoo.com> | 2022-11-10 12:28:12 -0800 |
---|---|---|
committer | Michael Gran <spk121@yahoo.com> | 2025-03-30 18:02:21 -0700 |
commit | 9d625278f7ff80a69e8dc8bd95a983af972d7955 (patch) | |
tree | d44c269a61a0ab09c1e19b62311eae9ca04e985a | |
parent | afda13e4ac2d1509605d0d2d0b5ef567994bc1e5 (diff) | |
download | guile-9d625278f7ff80a69e8dc8bd95a983af972d7955.tar.gz |
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.
-rw-r--r-- | test-suite/tests/filesys.test | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test-suite/tests/filesys.test b/test-suite/tests/filesys.test index 5ff738886..55f67e41a 100644 --- a/test-suite/tests/filesys.test +++ b/test-suite/tests/filesys.test @@ -434,14 +434,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" @@ -515,10 +522,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) |