1 source [file dirname [info script]]/testing.tcl
5 set havetty [expr {"tty" in [stdout -commands]}]
11 test tty-1.1 {tty status} {
13 dict exists $dict output
16 test tty-1.2 {tty bad param} -body {
18 } -returnCodes error -result {bad setting "bad": must be baud, data, echo, handshake, input, output, parity, stop, vmin, or vtime}
20 test tty-1.3 {tty bad baud} -body {
22 } -returnCodes error -result {bad value for baud: 12345}
24 test tty-1.4 {tty bad fd} -body {
25 set f [open [file tempfile] w]
27 } -returnCodes error -match regexp -result {^(Inappropriate ioctl for device|Not a tty)$} -cleanup {
33 foreach {param value} {
38 test tty-1.[incr n] "tty setting $param" -setup {
39 set savetty [stdout tty]
40 } -body "stdout tty $param $value; dict get \[stdout tty\] $param" \
41 -result $value -cleanup {
47 foreach param {output input handshake baud stop data vmin vtime} {
48 test tty-2.[incr n] "tty bad setting $param" -setup {
49 set savetty [stdout tty]
50 } -body "stdout tty $param bad" \
51 -returnCodes error -result "bad value for $param: bad" -cleanup {