1 # This file contains a collection of tests for the procedures in the file
2 # tclEvent.c, which includes the "update", and "vwait" Tcl commands. Sourcing
3 # this file into Tcl runs the tests and generates output for errors. No
4 # output means no errors were found.
6 # Copyright (c) 1995-1997 Sun Microsystems, Inc.
7 # Copyright (c) 1998-1999 by Scriptics Corporation.
9 # See the file "license.terms" for information on usage and redistribution
10 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
12 if {"::tcltest" ni [namespace children]} {
13 package require tcltest 2.5
14 namespace import -force ::tcltest::*
18 ::tcltest::loadTestedCommands
19 package require -exact Tcltest [info patchlevel]
20 set ::tcltestlib [lindex [package ifneeded Tcltest [info patchlevel]] 1]
24 testConstraint testfilehandler [llength [info commands testfilehandler]]
25 testConstraint testexithandler [llength [info commands testexithandler]]
26 testConstraint testfilewait [llength [info commands testfilewait]]
27 testConstraint exec [llength [info commands exec]]
28 testConstraint notOSX [expr {$::tcl_platform(os) ne "Darwin"}]
30 test event-1.1 {Tcl_CreateFileHandler, reading} -setup {
33 } -constraints {testfilehandler notOSX} -body {
34 testfilehandler create 0 readable off
35 testfilehandler clear 0
36 testfilehandler oneevent
37 lappend result [testfilehandler counts 0]
38 testfilehandler fillpartial 0
40 testfilehandler oneevent
41 lappend result [testfilehandler counts 0]
42 testfilehandler oneevent
43 lappend result [testfilehandler counts 0]
46 } -result {{0 0} {1 0} {2 0}}
47 test event-1.2 {Tcl_CreateFileHandler, writing} -setup {
50 } -constraints {testfilehandler nonPortable} -body {
51 # This test is non-portable because on some systems (e.g., SunOS 4.1.3)
52 # pipes seem to be writable always.
53 testfilehandler create 0 off writable
54 testfilehandler clear 0
55 testfilehandler oneevent
56 lappend result [testfilehandler counts 0]
57 testfilehandler fillpartial 0
58 testfilehandler oneevent
59 lappend result [testfilehandler counts 0]
60 testfilehandler fill 0
61 testfilehandler oneevent
62 lappend result [testfilehandler counts 0]
65 } -result {{0 1} {0 2} {0 2}}
66 test event-1.3 {Tcl_DeleteFileHandler} -setup {
69 } -constraints {testfilehandler nonPortable} -body {
70 testfilehandler create 2 disabled disabled
71 testfilehandler create 1 readable writable
72 testfilehandler create 0 disabled disabled
73 testfilehandler fillpartial 1
74 testfilehandler oneevent
75 lappend result [testfilehandler counts 1]
76 testfilehandler oneevent
77 lappend result [testfilehandler counts 1]
78 testfilehandler oneevent
79 lappend result [testfilehandler counts 1]
80 testfilehandler create 1 off off
81 testfilehandler oneevent
82 lappend result [testfilehandler counts 1]
85 } -result {{0 1} {1 1} {1 2} {0 0}}
87 test event-2.1 {Tcl_DeleteFileHandler} -setup {
90 } -constraints {testfilehandler nonPortable} -body {
91 testfilehandler create 2 disabled disabled
92 testfilehandler create 1 readable writable
93 testfilehandler fillpartial 1
94 testfilehandler oneevent
95 lappend result [testfilehandler counts 1]
96 testfilehandler oneevent
97 lappend result [testfilehandler counts 1]
98 testfilehandler oneevent
99 lappend result [testfilehandler counts 1]
100 testfilehandler create 1 off off
101 testfilehandler oneevent
102 lappend result [testfilehandler counts 1]
104 testfilehandler close
105 } -result {{0 1} {1 1} {1 2} {0 0}}
106 test event-2.2 {Tcl_DeleteFileHandler, fd reused & events still pending} -setup {
107 testfilehandler close
109 } -constraints {testfilehandler nonPortable} -body {
110 testfilehandler create 0 readable writable
111 testfilehandler fillpartial 0
112 testfilehandler oneevent
113 lappend result [testfilehandler counts 0]
114 testfilehandler close
115 testfilehandler create 0 readable writable
116 testfilehandler oneevent
117 lappend result [testfilehandler counts 0]
119 testfilehandler close
120 } -result {{0 1} {0 0}}
122 test event-3.1 {FileHandlerCheckProc, TCL_FILE_EVENTS off} -setup {
123 testfilehandler close
124 } -constraints {testfilehandler} -body {
125 testfilehandler create 1 readable writable
126 testfilehandler fillpartial 1
127 testfilehandler windowevent
128 testfilehandler counts 1
130 testfilehandler close
133 test event-4.1 {FileHandlerEventProc, race between event and disabling} -setup {
135 testfilehandler close
137 } -constraints {testfilehandler nonPortable} -body {
138 testfilehandler create 2 disabled disabled
139 testfilehandler create 1 readable writable
140 testfilehandler fillpartial 1
141 testfilehandler oneevent
142 lappend result [testfilehandler counts 1]
143 testfilehandler oneevent
144 lappend result [testfilehandler counts 1]
145 testfilehandler oneevent
146 lappend result [testfilehandler counts 1]
147 testfilehandler create 1 disabled disabled
148 testfilehandler oneevent
149 lappend result [testfilehandler counts 1]
151 testfilehandler close
152 } -result {{0 1} {1 1} {1 2} {0 0}}
153 test event-4.2 {FileHandlerEventProc, TCL_FILE_EVENTS off} -setup {
155 testfilehandler close
156 } -constraints {testfilehandler nonPortable} -body {
157 testfilehandler create 1 readable writable
158 testfilehandler create 2 readable writable
159 testfilehandler fillpartial 1
160 testfilehandler fillpartial 2
161 testfilehandler oneevent
163 lappend result [testfilehandler counts 1] [testfilehandler counts 2]
164 testfilehandler windowevent
165 lappend result [testfilehandler counts 1] [testfilehandler counts 2]
167 testfilehandler close
168 } -result {{0 0} {0 1} {0 0} {0 1}}
171 test event-5.1 {Tcl_BackgroundError, HandleBgErrors procedures} -setup {
172 catch {rename bgerror {}}
175 global errorInfo errorCode x
176 lappend x [list $msg $errorInfo $errorCode]
178 after idle {error "a simple error"}
179 after idle {open non_existent}
180 after idle {set errorInfo foobar; set errorCode xyzzy}
183 regsub -all [file join {} non_existent] $x "non_existent"
186 } -result {{{a simple error} {a simple error
188 "error "a simple error""
189 ("after" script)} NONE} {{couldn't open "non_existent": no such file or directory} {couldn't open "non_existent": no such file or directory
192 ("after" script)} {POSIX ENOENT {no such file or directory}}}}
193 test event-5.2 {Tcl_BackgroundError, HandleBgErrors procedures} -setup {
194 catch {rename bgerror {}}
201 after idle {error "a simple error"}
202 after idle {open non_existent}
208 } -result {{a simple error}}
209 test event-5.3 {HandleBgErrors: [Bug 1670155]} -setup {
211 proc demo args {variable x done}
212 variable target [list [namespace which demo] x]
213 proc trial args {variable target; string length $target}
214 trace add execution demo enter [namespace code trial]
215 variable save [interp bgerror {}]
216 interp bgerror {} $target
219 vwait [namespace which -variable x]
221 interp bgerror {} $save
226 test event-5.3.1 {Default [interp bgerror] handler} -body {
228 } -returnCodes error -match glob -result {*msg options*}
229 test event-5.4 {Default [interp bgerror] handler} -body {
231 } -returnCodes error -match glob -result {*msg options*}
232 test event-5.5 {Default [interp bgerror] handler} -body {
233 ::tcl::Bgerror {} {} {}
234 } -returnCodes error -match glob -result {*msg options*}
235 test event-5.6 {Default [interp bgerror] handler} -body {
237 } -returnCodes error -match glob -result {*-level*}
238 test event-5.7 {Default [interp bgerror] handler} -body {
239 ::tcl::Bgerror {} {-level foo}
240 } -returnCodes error -match glob -result {*expected integer*}
241 test event-5.8 {Default [interp bgerror] handler} -body {
242 ::tcl::Bgerror {} {-level 0}
243 } -returnCodes error -match glob -result {*-code*}
244 test event-5.9 {Default [interp bgerror] handler} -body {
245 ::tcl::Bgerror {} {-level 0 -code ok}
246 } -returnCodes error -match glob -result {*expected integer*}
247 test event-5.10 {Default [interp bgerror] handler} -body {
248 proc bgerror {m} {append ::res $m}
250 ::tcl::Bgerror {} {-level 0 -code 0}
255 test event-5.11 {Default [interp bgerror] handler} -body {
256 proc bgerror {m} {append ::res $m}
258 ::tcl::Bgerror msg {-level 0 -code 1}
263 test event-5.12 {Default [interp bgerror] handler} -body {
264 proc bgerror {m} {append ::res $m}
266 ::tcl::Bgerror msg {-level 0 -code 2}
270 } -result {command returned bad code: 2}
271 test event-5.13 {Default [interp bgerror] handler} -body {
272 proc bgerror {m} {append ::res $m}
274 ::tcl::Bgerror msg {-level 0 -code 3}
278 } -result {invoked "break" outside of a loop}
279 test event-5.14 {Default [interp bgerror] handler} -body {
280 proc bgerror {m} {append ::res $m}
282 ::tcl::Bgerror msg {-level 0 -code 4}
286 } -result {invoked "continue" outside of a loop}
287 test event-5.15 {Default [interp bgerror] handler} -body {
288 proc bgerror {m} {append ::res $m}
290 ::tcl::Bgerror msg {-level 0 -code 5}
294 } -result {command returned bad code: 5}
296 test event-6.1 {BgErrorDeleteProc procedure} -setup {
297 catch {interp delete foo}
299 set erroutfile [makeFile Unmodified err.out]
301 foo eval [list set erroutfile $erroutfile]
304 global errorInfo erroutfile
305 set f [open $erroutfile r+]
307 puts $f "$args $errorInfo"
310 after 100 {error "first error"}
311 after 100 {error "second error"}
313 after 100 {interp delete foo}
316 set f [open $erroutfile r]
321 removeFile $erroutfile
322 } -result {Unmodified
325 test event-7.1 {bgerror / regular} {
335 test event-7.2 {bgerror / accumulation} {
347 test event-7.3 {bgerror / accumulation / break} {
352 return -code break "skip!"
360 test event-7.4 {tkerror is nothing special anymore to tcl} -body {
362 # we don't just rename bgerror to empty because it could then
366 lappend errRes "bg:$err"
370 lappend errRes "tk:$err"
378 test event-7.5 {correct behaviour when there is no bgerror [Bug 219142]} -body {
379 exec [interpreter] << {
380 after 1000 error hello
384 } -constraints {exec} -returnCodes error -result {hello
388 test event-7.6 {safe hidden bgerror fallback} -setup {
390 interp create -safe safe
393 safe alias result ::append [namespace which -variable result]
394 safe eval {proc bgerror m {result $m\n$::errorCode\n$::errorInfo\n}}
396 safe eval after 0 error foo
408 test event-7.7 {safe hidden bgerror fallback} -setup {
410 interp create -safe safe
413 safe alias result ::append [namespace which -variable result]
414 safe eval {proc bgerror m {result $m\n$::errorCode\n$::errorInfo\n}}
416 safe eval {proc bgerror m {error bar soom baz}}
417 safe eval after 0 error foo
430 # someday : add a test checking that when there is no bgerror, an error msg
431 # goes to stderr ideally one would use sub interp and transfer a fake stderr
432 # to it, unfortunatly the current interp tcl API does not allow that. The
433 # other option would be to use fork a test but it then becomes more a
434 # file/exec test than a bgerror test.
436 # end of bgerror tests
437 catch {rename bgerror {}}
439 test event-8.1 {Tcl_CreateExitHandler procedure} {stdio testexithandler} {
440 set child [open |[list [interpreter]] r+]
441 puts $child "catch {load $::tcltestlib Tcltest}"
442 puts $child "testexithandler create 41; testexithandler create 4"
443 puts $child "testexithandler create 6; exit"
445 set result [read $child]
453 test event-9.1 {Tcl_DeleteExitHandler procedure} {stdio testexithandler} {
454 set child [open |[list [interpreter]] r+]
455 puts $child "catch {load $::tcltestlib Tcltest}"
456 puts $child "testexithandler create 41; testexithandler create 4"
457 puts $child "testexithandler create 6; testexithandler delete 41"
458 puts $child "testexithandler create 16; exit"
460 set result [read $child]
467 test event-9.2 {Tcl_DeleteExitHandler procedure} {stdio testexithandler} {
468 set child [open |[list [interpreter]] r+]
469 puts $child "catch {load $::tcltestlib Tcltest}"
470 puts $child "testexithandler create 41; testexithandler create 4"
471 puts $child "testexithandler create 6; testexithandler delete 4"
472 puts $child "testexithandler create 16; exit"
474 set result [read $child]
481 test event-9.3 {Tcl_DeleteExitHandler procedure} {stdio testexithandler} {
482 set child [open |[list [interpreter]] r+]
483 puts $child "catch {load $::tcltestlib Tcltest}"
484 puts $child "testexithandler create 41; testexithandler create 4"
485 puts $child "testexithandler create 6; testexithandler delete 6"
486 puts $child "testexithandler create 16; exit"
488 set result [read $child]
495 test event-9.4 {Tcl_DeleteExitHandler procedure} {stdio testexithandler} {
496 set child [open |[list [interpreter]] r+]
497 puts $child "catch {load $::tcltestlib Tcltest}"
498 puts $child "testexithandler create 41; testexithandler delete 41"
499 puts $child "testexithandler create 16; exit"
501 set result [read $child]
507 test event-10.1 {Tcl_Exit procedure} {stdio} {
508 set child [open |[list [interpreter]] r+]
510 list [catch {close $child} msg] $msg [lindex $::errorCode 0] \
511 [lindex $::errorCode 2]
512 } {1 {child process exited abnormally} CHILDSTATUS 3}
514 test event-11.1 {Tcl_VwaitCmd procedure} -returnCodes error -body {
516 } -result {wrong # args: should be "vwait name"}
517 test event-11.2 {Tcl_VwaitCmd procedure} -returnCodes error -body {
519 } -result {wrong # args: should be "vwait name"}
520 test event-11.3 {Tcl_VwaitCmd procedure} -setup {
525 } -returnCodes error -result {can't trace "x(1)": variable isn't array}
526 test event-11.4 {Tcl_VwaitCmd procedure} -setup {
527 foreach i [after info] {
530 after 10; update; # On Mac make sure update won't take long
532 after 100 {set x x-done}
533 after 200 {set y y-done}
534 after 400 {set z z-done}
535 after idle {set q q-done}
540 list [vwait y] $x $y $z $q
542 foreach i [after info] {
545 } -result {{} x-done y-done before q-done}
546 test event-11.5 {Tcl_VwaitCmd procedure: round robin scheduling, 2 sources} -setup {
547 set test1file [makeFile "" test1]
548 } -constraints {socket} -body {
549 set f1 [open $test1file w]
550 proc accept {s args} {
554 set s1 [socket -server accept -myaddr 127.0.0.1 0]
556 set s2 [socket 127.0.0.1 [lindex [fconfigure $s1 -sockname] 2]]
561 fileevent $s2 readable {incr z}
563 fileevent $f1 writable {incr x; if {$y == 3} {set z done}}
564 fileevent $s2 readable {incr y; if {$x == 3} {set z done}}
570 removeFile $test1file
572 test event-11.6 {Tcl_VwaitCmd procedure: round robin scheduling, same source} {
573 set test1file [makeFile "" test1]
574 set test2file [makeFile "" test2]
575 set f1 [open $test1file w]
576 set f2 [open $test2file w]
581 fileevent $f1 writable {incr x; if {$y == 3} {set z done}}
582 fileevent $f2 writable {incr y; if {$x == 3} {set z done}}
586 removeFile $test1file
587 removeFile $test2file
590 test event-11.7 {Bug 16828b3744} {
599 test event-11.8 {Bug 16828b3744} -setup {
604 after idle [self] destroy
607 vwait [namespace current]::continue
619 test event-12.1 {Tcl_UpdateCmd procedure} -returnCodes error -body {
621 } -result {wrong # args: should be "update ?idletasks?"}
622 test event-12.2 {Tcl_UpdateCmd procedure} -returnCodes error -body {
624 } -result {bad option "bogus": must be idletasks}
625 test event-12.3 {Tcl_UpdateCmd procedure} -setup {
626 foreach i [after info] {
630 after 500 {set x after}
631 after idle {set y after}
632 after idle {set z "after, y = $y"}
639 foreach i [after info] {
642 } -result {before after {after, y = after}}
643 test event-12.4 {Tcl_UpdateCmd procedure} -setup {
644 foreach i [after info] {
648 after 10; update; # On Mac make sure update won't take long
649 after 200 {set x x-done}
650 after 600 {set y y-done}
651 after idle {set z z-done}
659 foreach i [after info] {
662 } -result {x-done before z-done}
664 test event-13.1 {Tcl_WaitForFile procedure, readable} -setup {
665 foreach i [after info] {
668 testfilehandler close
669 } -constraints {testfilehandler} -body {
670 after 100 set x timeout
671 testfilehandler create 1 off off
673 set result [testfilehandler wait 1 readable 0]
677 testfilehandler close
678 foreach i [after info] {
681 } -result {{} {no timeout}}
682 test event-13.2 {Tcl_WaitForFile procedure, readable} -setup {
683 foreach i [after info] {
686 testfilehandler close
687 } -constraints testfilehandler -body {
688 after 100 set x timeout
689 testfilehandler create 1 off off
691 set result [testfilehandler wait 1 readable 100]
695 testfilehandler close
696 foreach i [after info] {
699 } -result {{} timeout}
700 test event-13.3 {Tcl_WaitForFile procedure, readable} -setup {
701 foreach i [after info] {
704 testfilehandler close
705 } -constraints testfilehandler -body {
706 after 100 set x timeout
707 testfilehandler create 1 off off
708 testfilehandler fillpartial 1
710 set result [testfilehandler wait 1 readable 100]
714 testfilehandler close
715 foreach i [after info] {
718 } -result {readable {no timeout}}
719 test event-13.4 {Tcl_WaitForFile procedure, writable} -setup {
720 foreach i [after info] {
723 testfilehandler close
724 } -constraints {testfilehandler nonPortable} -body {
725 after 100 set x timeout
726 testfilehandler create 1 off off
727 testfilehandler fill 1
729 set result [testfilehandler wait 1 writable 0]
733 testfilehandler close
734 foreach i [after info] {
737 } -result {{} {no timeout}}
738 test event-13.5 {Tcl_WaitForFile procedure, writable} -setup {
739 foreach i [after info] {
742 testfilehandler close
743 } -constraints {testfilehandler nonPortable} -body {
744 after 100 set x timeout
745 testfilehandler create 1 off off
746 testfilehandler fill 1
748 set result [testfilehandler wait 1 writable 100]
752 testfilehandler close
753 foreach i [after info] {
756 } -result {{} timeout}
757 test event-13.6 {Tcl_WaitForFile procedure, writable} -setup {
758 foreach i [after info] {
761 testfilehandler close
762 } -constraints testfilehandler -body {
763 after 100 set x timeout
764 testfilehandler create 1 off off
766 set result [testfilehandler wait 1 writable 100]
770 testfilehandler close
771 foreach i [after info] {
774 } -result {writable {no timeout}}
775 test event-13.7 {Tcl_WaitForFile procedure, don't call other event handlers} -setup {
776 foreach i [after info] {
779 testfilehandler close
780 } -constraints testfilehandler -body {
781 after 100 lappend x timeout
782 after idle lappend x idle
783 testfilehandler create 1 off off
785 set result [list [testfilehandler wait 1 readable 200] $x]
789 testfilehandler close
790 foreach i [after info] {
793 } -result {{} {} {timeout idle}}
794 test event-13.8 {Tcl_WaitForFile procedure, waiting indefinitely} testfilewait {
795 set f [open "|sleep 2" r]
797 lappend result [testfilewait $f readable 100]
798 lappend result [testfilewait $f readable -1]
803 test event-14.1 {Tcl_WaitForFile procedure, readable, big fd} -setup {
805 for {set i 0} {$i < 32} {incr i} {
806 lappend chanList [open /dev/null r]
808 foreach i [after info] {after cancel $i}
809 testfilehandler close
810 } -constraints {testfilehandler unix} -body {
811 after 100 set x timeout
812 testfilehandler create 1 off off
814 set result [testfilehandler wait 1 readable 0]
818 testfilehandler close
819 foreach chan $chanList {close $chan}
820 foreach i [after info] {after cancel $i}
821 } -result {{} {no timeout}}
822 test event-14.2 {Tcl_WaitForFile procedure, readable, big fd} -setup {
824 for {set i 0} {$i < 32} {incr i} {
825 lappend chanList [open /dev/null r]
827 foreach i [after info] {after cancel $i}
828 testfilehandler close
829 } -constraints {testfilehandler unix} -body {
830 after 100 set x timeout
831 testfilehandler create 1 off off
833 set result [testfilehandler wait 1 readable 100]
837 testfilehandler close
838 foreach chan $chanList {close $chan}
839 foreach i [after info] {after cancel $i}
840 } -result {{} timeout}
841 test event-14.3 {Tcl_WaitForFile procedure, readable, big fd} -setup {
843 for {set i 0} {$i < 32} {incr i} {
844 lappend chanList [open /dev/null r]
846 foreach i [after info] {after cancel $i}
847 testfilehandler close
848 } -constraints {testfilehandler unix} -body {
849 after 100 set x timeout
850 testfilehandler create 1 off off
851 testfilehandler fillpartial 1
853 set result [testfilehandler wait 1 readable 100]
857 testfilehandler close
858 foreach chan $chanList {close $chan}
859 foreach i [after info] {after cancel $i}
860 } -result {readable {no timeout}}
861 test event-14.4 {Tcl_WaitForFile procedure, writable, big fd} -setup {
863 for {set i 0} {$i < 32} {incr i} {
864 lappend chanList [open /dev/null r]
866 foreach i [after info] {after cancel $i}
867 testfilehandler close
868 } -constraints {testfilehandler unix nonPortable} -body {
869 after 100 set x timeout
870 testfilehandler create 1 off off
871 testfilehandler fill 1
873 set result [testfilehandler wait 1 writable 0]
877 testfilehandler close
878 foreach chan $chanList {close $chan}
879 foreach i [after info] {after cancel $i}
880 } -result {{} {no timeout}}
881 test event-14.5 {Tcl_WaitForFile procedure, writable, big fd} -setup {
883 for {set i 0} {$i < 32} {incr i} {
884 lappend chanList [open /dev/null r]
886 foreach i [after info] {after cancel $i}
887 testfilehandler close
888 } -constraints {testfilehandler unix nonPortable} -body {
889 after 100 set x timeout
890 testfilehandler create 1 off off
891 testfilehandler fill 1
893 set result [testfilehandler wait 1 writable 100]
897 testfilehandler close
898 foreach chan $chanList {close $chan}
899 foreach i [after info] {after cancel $i}
900 } -result {{} timeout}
901 test event-14.6 {Tcl_WaitForFile procedure, writable, big fd} -setup {
903 for {set i 0} {$i < 32} {incr i} {
904 lappend chanList [open /dev/null r]
906 foreach i [after info] {after cancel $i}
907 testfilehandler close
908 } -constraints {testfilehandler unix} -body {
909 after 100 set x timeout
910 testfilehandler create 1 off off
912 set result [testfilehandler wait 1 writable 100]
916 testfilehandler close
917 foreach chan $chanList {close $chan}
918 foreach i [after info] {after cancel $i}
919 } -result {writable {no timeout}}
920 test event-14.7 {Tcl_WaitForFile, don't call other event handlers, big fd} -setup {
922 for {set i 0} {$i < 32} {incr i} {
923 lappend chanList [open /dev/null r]
925 foreach i [after info] {after cancel $i}
926 testfilehandler close
927 } -constraints {testfilehandler unix} -body {
928 after 100 lappend x timeout
929 after idle lappend x idle
930 testfilehandler create 1 off off
932 set result [list [testfilehandler wait 1 readable 200] $x]
936 testfilehandler close
937 foreach chan $chanList {close $chan}
938 foreach i [after info] {after cancel $i}
939 } -result {{} {} {timeout idle}}
940 test event-14.8 {Tcl_WaitForFile procedure, waiting indefinitely, big fd} -setup {
942 for {set i 0} {$i < 32} {incr i} {
943 lappend chanList [open /dev/null r]
945 } -constraints {testfilewait unix} -body {
946 set f [open "|sleep 2" r]
948 lappend result [testfilewait $f readable 100]
949 lappend result [testfilewait $f readable -1]
953 foreach chan $chanList {close $chan}
954 } -result {{} readable}
957 foreach i [after info] {
960 ::tcltest::cleanupTests