source: project/release/4/pty/tags/1.4/pty-test.scm @ 27071

Last change on this file since 27071 was 27071, checked in by Alex Shinn, 9 years ago

need to include <termios.h> for struct winsize

File size: 1.1 KB
Line 
1;;;; pty-test.scm
2
3(use test)
4(use pty)
5
6(test-begin "pty")
7
8(test-error (call-with-pty-process-io "foo" 'foo))
9
10;** PROBLEM **
11;Port out appears echoed to in
12;Repeat runs have caused system crash on MacOS 10.4
13;Repeat runs have caused process pend on MacOS 10.4
14;Must be using 'bc' wrong
15;; (test 3.1415926532
16;;     (call-with-pty-process-io
17;;      '("/usr/bin/bc" "-lqi")
18;;      (lambda (in out pid)
19;;        ;;operation
20;;        (display "scale=10; 4*a(1)" out) (newline out)
21;;        ;;result
22;;        (let ((res (read in)))
23;;          ;; clean termination
24;;          (display "quit\n" out)
25;;          res))))
26
27(test '("meters" "feet" "\t* 3.2808399" "\t/ 0.3048")
28    (call-with-pty-process-io
29     '("/usr/bin/units" "-q")
30     (lambda (in out pid)
31       ;; operation
32       (display "meters" out) (newline out)
33       (display "feet" out) (newline out)
34       ;; result
35       (let ((res (list (read-line in) (read-line in)
36                        (read-line in) (read-line in))))
37         ;; clean termination - send EOT
38         (display (integer->char 4) out)
39         res))))
40
41(test-end)
Note: See TracBrowser for help on using the repository browser.