]> gitweb.factorcode.org Git - factor.git/blob - extra/io/serial/unix/unix-tests.factor
f9b047c87b8686953fe42fc0b7772d84a43c1b13
[factor.git] / extra / io / serial / unix / unix-tests.factor
1 ! Copyright (C) 2008 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors io io.serial io.serial.unix kernel literals
4 math.bitwise tools.test ;
5 IN: io.serial.unix
6
7 ! "/dev/ttyS0" ! netbsd
8 ! "/dev/dty00" ! netbsd
9 ! "/dev/ttyd0" ! freebsd
10 ! "/dev/ttyU0" ! openbsd
11
12 : <serial-port-test> ( -- serial-port )
13     "/dev/ttyS0" 19200 <serial-port> ;
14
15 : with-serial-port-test ( quot -- )
16     [ <serial-port-test> ] dip with-serial-port ; inline
17
18 ! [ ] [
19     ! [ "hello" over stream-write stream-flush ] with-serial-port-test
20 ! ] unit-test