1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-21 20:20:24 +02:00

tests: Improve lack-of-/dev/null detection.

Suggested by Eli Zaretskii <eliz@gnu.org>.

* test-suite/test-suite/lib.scm (%null-device): Test for Windows based
  by checking for a drive letter in the current directory name.
This commit is contained in:
Ludovic Courtès 2014-06-12 23:19:29 +02:00
parent 700f6cd86b
commit f089330846

View file

@ -578,9 +578,12 @@
;; On Windows (MinGW), /dev/null does not exist and we must instead
;; use NUL. Note that file system procedures automatically translate
;; /dev/null, so this variable is only useful for shell snippets.
(if (file-exists? "/dev/null")
"/dev/null"
"NUL"))
;; Test for Windowsness by checking whether the current directory name
;; starts with a drive letter.
(if (string-match "^[a-zA-Z]:[/\\]" (getcwd))
"NUL"
"/dev/null"))
;;;; REPORTERS