代码拉取完成,页面将自动刷新
source [file dirname [info script]]/testing.tcl
set havetty 0
catch {
set havetty [expr {"tty" in [stdout -commands]}]
}
if {!$havetty || ![stdout isatty]} {
skiptest " (aio tty)"
}
test tty-1.1 {tty status} {
set dict [stdout tty]
dict exists $dict output
} 1
test tty-1.2 {tty bad param} -body {
stdout tty bad value
} -returnCodes error -result {bad setting "bad": must be baud, data, echo, handshake, input, output, parity, stop, vmin, or vtime}
test tty-1.3 {tty bad baud} -body {
stdout tty baud 12345
} -returnCodes error -result {bad value for baud: 12345}
test tty-1.4 {tty bad fd} -body {
set f [open [file tempfile] w]
$f tty
} -returnCodes error -match regexp -result {^(Inappropriate ioctl for device|Not a tty)$} -cleanup {
$f close
}
set n 0
foreach {param value} {
output raw
input raw
handshake rtscts
} {
test tty-1.[incr n] "tty setting $param" -setup {
set savetty [stdout tty]
} -body "stdout tty $param $value; dict get \[stdout tty\] $param" \
-result $value -cleanup {
stdout tty $savetty
}
}
set n 0
foreach param {output input handshake baud stop data vmin vtime} {
test tty-2.[incr n] "tty bad setting $param" -setup {
set savetty [stdout tty]
} -body "stdout tty $param bad" \
-returnCodes error -result "bad value for $param: bad" -cleanup {
stdout tty $savetty
}
}
testreport
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。