From 6d276bccd10908791970fcb6b2591bbf85dd45e3 Mon Sep 17 00:00:00 2001 From: hershey Date: Tue, 18 May 1999 20:17:59 +0000 Subject: added -encoding to the list of legal options used in the error message when a bad option is used. Because the fconfigure command is configurable (so more option can be added), the error string is hardcoded. --- generic/tclIO.c | 4 ++-- tests/ioCmd.test | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/generic/tclIO.c b/generic/tclIO.c index 3e9ae4d..bc8db94 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIO.c,v 1.7 1999/04/21 21:50:25 rjohnson Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.8 1999/05/18 20:17:59 hershey Exp $ */ #include "tclInt.h" @@ -4924,7 +4924,7 @@ Tcl_BadChannelOption(interp, optionName, optionList) { if (interp) { CONST char *genericopt = - "blocking buffering buffersize eofchar translation"; + "blocking buffering buffersize encoding eofchar translation"; char **argv; int argc, i; Tcl_DString ds; diff --git a/tests/ioCmd.test b/tests/ioCmd.test index bb05635..3ff3cb5 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.4 1999/05/06 18:46:43 stanton Exp $ +# RCS: @(#) $Id: ioCmd.test,v 1.5 1999/05/18 20:18:38 hershey Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { source [file join [pwd] [file dirname [info script]] defs.tcl] @@ -198,7 +198,7 @@ test iocmd-8.4 {fconfigure command} { set x [list [catch {fconfigure $f1 froboz} msg] $msg] close $f1 set x -} {1 {bad option "froboz": should be one of -blocking, -buffering, -buffersize, -eofchar, or -translation}} +} {1 {bad option "froboz": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, or -translation}} test iocmd-8.5 {fconfigure command} { list [catch {fconfigure stdin -buffering froboz} msg] $msg } {1 {bad value for -buffering: must be one of full, line, or none}} @@ -238,13 +238,13 @@ test iocmd-8.10 {fconfigure command} { } {1 {can not find channel named "a"}} test iocmd-8.11 {fconfigure command} { list [catch {fconfigure stdout -froboz blarfo} msg] $msg -} {1 {bad option "-froboz": should be one of -blocking, -buffering, -buffersize, -eofchar, or -translation}} +} {1 {bad option "-froboz": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, or -translation}} test iocmd-8.12 {fconfigure command} { list [catch {fconfigure stdout -b blarfo} msg] $msg -} {1 {bad option "-b": should be one of -blocking, -buffering, -buffersize, -eofchar, or -translation}} +} {1 {bad option "-b": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, or -translation}} test iocmd-8.13 {fconfigure command} { list [catch {fconfigure stdout -buffer blarfo} msg] $msg -} {1 {bad option "-buffer": should be one of -blocking, -buffering, -buffersize, -eofchar, or -translation}} +} {1 {bad option "-buffer": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, or -translation}} test iocmd-8.14 {fconfigure command} { fconfigure stdin -buffers } 4096 @@ -270,7 +270,7 @@ test iocmd-8.15 {fconfigure command / tcp channel} {socket} { set r [list [catch {fconfigure $cli -blah} msg] $msg]; iocmdSSHTDWN set r; -} {1 {bad option "-blah": should be one of -blocking, -buffering, -buffersize, -eofchar, -translation, -peername, or -sockname}} +} {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]; @@ -295,14 +295,14 @@ test iocmd-8.18 {fconfigure command / unix tty channel} {nonPortable unixOnly} { set r [list [catch {fconfigure $tty -blah blih} msg] $msg]; close $tty; set r; -} {1 {bad option "-blah": should be one of -blocking, -buffering, -buffersize, -eofchar, -translation, or -mode}} +} {1 {bad option "-blah": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, -translation, or -mode}} test iocmd-8.19 {fconfigure command / win tty channel} {nonPortable pcOnly} { # might fail if com1 is unavailable set tty [open com1] set r [list [catch {fconfigure $tty -blah blih} msg] $msg]; close $tty; set r; -} {1 {bad option "-blah": should be one of -blocking, -buffering, -buffersize, -eofchar, -translation, or -mode}} +} {1 {bad option "-blah": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, -translation, or -mode}} test iocmd-9.1 {eof command} { list [catch {eof} msg] $msg $errorCode -- cgit v0.12