summaryrefslogtreecommitdiffstats
path: root/tests/chan.test
diff options
context:
space:
mode:
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 ...?\""