~ubuntu-branches/ubuntu/raring/tcl8.5/raring

« back to all changes in this revision

Viewing changes to tests/ioCmd.test

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2011-06-26 11:47:14 UTC
  • mfrom: (11.2.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110626114714-mdw95b180f00mm08
Tags: 8.5.10-1
* New upstream release (closes: #617628).
* Changed tclsh8.5 alternative priority to 850 to make it higher than
  tclsh8.4 one.
* Bumped standards version to 3.9.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# See the file "license.terms" for information on usage and redistribution
14
14
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
15
 
#
16
 
# RCS: @(#) $Id: ioCmd.test,v 1.36.2.9 2010/08/03 20:06:34 dgp Exp $
17
15
 
18
16
if {[lsearch [namespace children] ::tcltest] == -1} {
19
17
    package require tcltest 2
35
33
} {1 {wrong # args: should be "puts ?-nonewline? ?channelId? string"}}
36
34
test iocmd-1.3 {puts command} {
37
35
   list [catch {puts froboz -nonewline kablooie} msg] $msg
38
 
} {1 {bad argument "kablooie": should be "nonewline"}}
 
36
} {1 {wrong # args: should be "puts ?-nonewline? ?channelId? string"}}
39
37
test iocmd-1.4 {puts command} {
40
38
   list [catch {puts froboz hello} msg] $msg
41
39
} {1 {can not find channel named "froboz"}}
138
136
} {1 {wrong # args: should be "read channelId ?numChars?" or "read ?-nonewline? channelId"} NONE}
139
137
test iocmd-4.9 {read command} {
140
138
    list [catch {read stdin foo} msg] $msg $::errorCode
141
 
} {1 {bad argument "foo": should be "nonewline"} NONE}
 
139
} {1 {expected integer but got "foo"} {TCL VALUE NUMBER}}
142
140
test iocmd-4.10 {read command} {
143
141
    list [catch {read file107} msg] $msg $::errorCode
144
142
} {1 {can not find channel named "file107"} {TCL LOOKUP CHANNEL file107}}
155
153
    set x [list [catch {read $f 12z} msg] $msg $::errorCode]
156
154
    close $f
157
155
    set x
158
 
} {1 {expected integer but got "12z"} NONE}
 
156
} {1 {expected integer but got "12z"} {TCL VALUE NUMBER}}
159
157
 
160
158
test iocmd-5.1 {seek command} {
161
159
    list [catch {seek} msg] $msg
1942
1940
        proc foo {args} {
1943
1941
            oninit; onfinal; track;
1944
1942
            # destroy interpreter during channel access
1945
 
            # Actually not possible for an interp to destory itself.
 
1943
            # Actually not possible for an interp to destroy itself.
1946
1944
            interp delete {}
1947
1945
            return}
1948
1946
        set chan [chan create {r w} foo]