From ef554a7319904dda4b8985204f3878276e44bd04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 20 Jan 2020 22:43:22 +0100 Subject: Fix termios tests. --- tests/termios.scm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/termios.scm b/tests/termios.scm index 22d8e242..f07d20a0 100755 --- a/tests/termios.scm +++ b/tests/termios.scm @@ -16,21 +16,24 @@ ((srfi srfi-60) (bitwise-ior . ||) (bitwise-not . ~) - (bitwise-and . &))) + (bitwise-and . &)) + ((guile) open-input-file)) + +(define tty (open-input-file "/dev/tty")) (define-syntax-rule (&= lvalue val) (mod! lvalue (lambda (v) (& v val)))) (define t (make-termios)) -(test-equal 0 (tcgetattr! t)) +(test-equal 0 (tcgetattr! t tty)) (define ifl (lflag t)) (define copy (copy-termios t)) #!curly-infix { (lflag t) &= (~ (|| ECHO ICANON)) } -(test-equal 0 (tcsetattr! t)) +(test-equal 0 (tcsetattr! t tty)) (test-equal (& ifl (~ (|| ECHO ICANON))) (lflag t)) -(test-equal 0 (tcsetattr! copy)) +(test-equal 0 (tcsetattr! copy tty)) -- cgit v1.2.3