summaryrefslogtreecommitdiffstats
path: root/tests/chan.test
diff options
context:
space:
mode:
authorferrieux <ferrieux@users.sourceforge.net>2008-12-18 01:14:16 (GMT)
committerferrieux <ferrieux@users.sourceforge.net>2008-12-18 01:14:16 (GMT)
commita189e6bf469919f77d6e9884d112c93599363de5 (patch)
tree087ebe5ba2e9e57828831c8ad3ba41d50edb7eb4 /tests/chan.test
parentcd0108cccb852eff4a8a65fa1e68297e85bc12ec (diff)
downloadtcl-a189e6bf469919f77d6e9884d112c93599363de5.zip
tcl-a189e6bf469919f77d6e9884d112c93599363de5.tar.gz
tcl-a189e6bf469919f77d6e9884d112c93599363de5.tar.bz2
TIP #332 IMPLEMENTATION - Half-Close for Bidirectional Channels
Diffstat (limited to 'tests/chan.test')
-rw-r--r--tests/chan.test22
1 files changed, 17 insertions, 5 deletions
diff --git a/tests/chan.test b/tests/chan.test
index 39dd111..7dccda7 100644
--- a/tests/chan.test
+++ b/tests/chan.test
@@ -7,7 +7,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: chan.test,v 1.15 2008/07/21 21:02:19 ferrieux Exp $
+# RCS: @(#) $Id: chan.test,v 1.16 2008/12/18 01:14:17 ferrieux Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -29,11 +29,23 @@ test chan-1.2 {chan command general syntax} -body {
test chan-2.1 {chan command: blocked subcommand} -body {
chan blocked foo bar
} -returnCodes error -result "wrong # args: should be \"chan blocked channelId\""
-
test chan-3.1 {chan command: close subcommand} -body {
- chan close foo bar
-} -returnCodes error -result "wrong # args: should be \"chan close channelId\""
-
+ chan close foo bar zet
+} -returnCodes error -result "wrong # args: should be \"chan close channelId ?direction?\""
+test chan-3.2 {chan command: close subcommand} -setup {
+ set chan [open [info script] r]
+} -body {
+ chan close $chan bar
+} -cleanup {
+ close $chan
+} -returnCodes error -result "bad direction \"bar\": must be read or write"
+test chan-3.3 {chan command: close subcommand} -setup {
+ set chan [open [info script] r]
+} -body {
+ chan close $chan write
+} -cleanup {
+ close $chan
+} -returnCodes error -result "Half-close of write-side not possible, side not opened or already closed"
test chan-4.1 {chan command: configure subcommand} -body {
chan configure
} -returnCodes error -result "wrong # args: should be \"chan configure channelId ?-option value ...?\""