aboutsummaryrefslogtreecommitdiff
path: root/tests/termios.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-03-07 15:31:00 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-03-07 20:29:14 +0100
commitf7716ac1a87649cad96242f2d5bf0a987d7f430c (patch)
treeb4b84951ef468fd644c42e9e0fee535d879f0387 /tests/termios.scm
parentCleanup in (hnh util path). (diff)
downloadcalp-f7716ac1a87649cad96242f2d5bf0a987d7f430c.tar.gz
calp-f7716ac1a87649cad96242f2d5bf0a987d7f430c.tar.xz
Add new tests.
Diffstat (limited to 'tests/termios.scm')
-rw-r--r--tests/termios.scm37
1 files changed, 0 insertions, 37 deletions
diff --git a/tests/termios.scm b/tests/termios.scm
deleted file mode 100644
index e54ddc9c..00000000
--- a/tests/termios.scm
+++ /dev/null
@@ -1,37 +0,0 @@
-;;; Commentary:
-;; Tests that my termios function works, at least somewhat.
-;; Note that this actually modifies the terminal it's run on, and might fail
-;; if the terminal doesn't support the wanted modes. See termios(3).
-;; It might also leave the terminal in a broken state if exited prematurely.
-;;; Code:
-
-(((hnh util) set!)
- ((vulgar termios)
- make-termios copy-termios
- lflag
- tcgetattr! tcsetattr!
- ECHO ICANON)
- ((srfi srfi-60)
- (bitwise-ior . ||)
- (bitwise-not . ~)
- (bitwise-and . &))
- ((guile) open-input-file))
-
-(define tty (open-input-file "/dev/tty"))
-
-(define-syntax-rule (&= lvalue val)
- (set! lvalue = ((lambda (v) (& v val)))))
-
-(define t (make-termios))
-
-(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 tty))
-(test-equal (& ifl (~ (|| ECHO ICANON)))
- (lflag t))
-(test-equal 0 (tcsetattr! copy tty))