diff --git a/tests/posix.lisp b/tests/posix.lisp index ee1e3bf050e26d32eb6c43cf3660f1f3cb912326..32a4eefad72b046f8536bd6da822af962a0c80f1 100644 --- a/tests/posix.lisp +++ b/tests/posix.lisp @@ -631,4 +631,27 @@ (handler-case (nix:mkdir "/" 0) (nix:posix-error (c) (nix:posix-error-syscall c))) - nix:mkdir) \ No newline at end of file + nix:mkdir) + +(define-posix-test isatty.1 + (let (fd) + (unwind-protect + (progn + (setf fd (nix:open "/tmp/isatty.test" nix:o-creat)) + (nix:isatty fd)) + (when fd + (nix:close fd)))) + 0) + +(define-posix-test isatty.1 + (let (fd) + (unwind-protect + (progn + (setf fd (ignore-errors (nix:open "/dev/tty" nix:o-rdwr))) + (if fd + (nix:isatty fd) + ;; FIXME: add pty stuff for proper testing + "could not open /dev/tty for testing isatty")) + (when fd + (nix:close fd)))) + 1)