diff options
-rw-r--r-- | tests/ioCmd.test | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/tests/ioCmd.test b/tests/ioCmd.test index cf7dfbb..bf7e3b3 100644 --- a/tests/ioCmd.test +++ b/tests/ioCmd.test @@ -12,7 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: ioCmd.test,v 1.12 2002/04/08 09:02:33 das Exp $ +# RCS: @(#) $Id: ioCmd.test,v 1.13 2002/04/12 06:23:31 hobbs Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -266,32 +266,39 @@ removeFile fconfigure.dummy test iocmd-8.14 {fconfigure command} { fconfigure stdin -buffers } 4096 + proc iocmdSSETUP {} { - uplevel { - set srv [socket -server iocmdSRV 0]; - set port [lindex [fconfigure $srv -sockname] 2]; + uplevel { + set srv [socket -server iocmdSRV 0] + set port [lindex [fconfigure $srv -sockname] 2] proc iocmdSRV {sock ip port} {close $sock} - set cli [socket 127.0.0.1 $port]; - } + set cli [socket 127.0.0.1 $port] + } } proc iocmdSSHTDWN {} { - uplevel { - close $cli; - close $srv; + uplevel { + close $cli + close $srv unset cli srv port rename iocmdSRV {} - } + } } -test iocmd-8.15 {fconfigure command / tcp channel} {socket} { +test iocmd-8.15.0 {fconfigure command / tcp channel} {socket macOnly} { iocmdSSETUP - set r [list [catch {fconfigure $cli -blah} msg] $msg]; + set r [list [catch {fconfigure $cli -blah} msg] $msg] iocmdSSHTDWN - set r; + set r } {1 {bad option "-blah": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, -translation, -error, -peername, or -sockname}} +test iocmd-8.15.1 {fconfigure command / tcp channel} {socket unixOrPc} { + iocmdSSETUP + set r [list [catch {fconfigure $cli -blah} msg] $msg] + iocmdSSHTDWN + set r +} {1 {bad option "-blah": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, -translation, -peername, or -sockname}} test iocmd-8.16 {fconfigure command / tcp channel} {socket} { iocmdSSETUP - set r [expr [lindex [fconfigure $cli -peername] 2]==$port]; + set r [expr [lindex [fconfigure $cli -peername] 2]==$port] iocmdSSHTDWN set r } 1 |