mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
tests: Skip mkdtemp test for invalid template on Darwin.
Darwin accepts any template, as demonstrated here: #include <stdio.h> #include <unistd.h> int main(void) { char template[] = {'T', '-', 'A', 'A', 'A', 'A', 'A', 'A', '\0'}; char *res = mkdtemp(template); puts(res ? res : "(null)"); perror("mkdtemp"); } Outputs: T-AAAAAA mkdtemp: Undefined error: 0 This does not match prescribed POSIX behavior, but it is what it is. * test-suite/tests/filesys.test (skip-on-darwin): New procedure. ("mkdtemp")["invalid template"]: Skip on Darwin. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
0ceb0036c3
commit
8579b73aba
1 changed files with 5 additions and 0 deletions
|
@ -34,6 +34,9 @@
|
|||
(define (test-directory2)
|
||||
(data-file-name "filesys-test-dir2.tmp"))
|
||||
|
||||
(define (skip-on-darwin)
|
||||
(when (string-ci=? "darwin" (utsname:sysname (uname)))
|
||||
(throw 'untested)))
|
||||
|
||||
;;;
|
||||
;;; copy-file
|
||||
|
@ -345,6 +348,8 @@
|
|||
(= (string-length name) 8)))))
|
||||
|
||||
(pass-if-exception "invalid template" exception:system-error
|
||||
;; MacOS accepts any template and just does no replacements.
|
||||
(skip-on-darwin)
|
||||
(if (not (defined? 'mkdtemp))
|
||||
(throw 'unresolved)
|
||||
(mkdtemp "T-AAAAAA")))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue