Tcl Source Code

Artifact [45536e89c9]
Login

Artifact 45536e89c975db8b1e5aa9e1700bb606a68f0d67:

Attachment "io.errs" to ticket [678400ffff] added by kennykb 2003-02-01 04:28:20.
io.test

==== io-14.9 reuse of stdio special channels FAILED
==== Contents of test case:

    removeFile script
    removeFile test1
    set f [open $path(script) w]
    puts $f {
        array set path [lindex $argv 0]
	set f [open $path(test1) w]
	puts $f hello
	close $f
	close stderr
	set f [open "|[list [info nameofexecutable] $path(cat) $path(test1)]" r]
	puts [gets $f]
    }
    close $f
    set f [open "|[list [interpreter] $path(script) [array get path]]" r]
    set c [gets $f]
    close $f
    set c

---- Result was:
can't read "path(test1)": no such element in array
    while executing
"open $path(test1) w"
    invoked from within
"set f [open $path(test1) w]"
    (file "C:/Documents and Settings/kennykb/My Documents/SourceForge/tcl/win/script" line 3)
---- Result should have been (exact matching):
hello
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== io-14.9 FAILED


==== io-29.32 Tcl_WriteChars, background flush to slow reader FAILED
==== Contents of test case:

    removeFile pipe
    removeFile output
    set f [open $path(pipe) w]
    puts $f [format {set f [open "%s" w]} $path(output)]
    puts $f {fconfigure $f -translation lf}
    set x [list while {![eof stdin]}]
    set x "$x {"
    puts $f $x
    puts $f {  after 20}
    puts $f {  puts -nonewline $f [read stdin 1024]}
    puts $f {  flush $f}
    puts $f "}"
    puts $f {close $f}
    close $f
    set x 01234567890123456789012345678901
    for {set i 0} {$i < 11} {incr i} {
	set x "$x$x"
    }
    set f [open $path(output) w]
    close $f
    set f [open "|[list [interpreter] $path(pipe)]" r+]
    fconfigure $f -blocking off
    puts -nonewline $f $x
    close $f
    set counter 0
    while {([file size $path(output)] < 65536) && ($counter < 1000)} {
	incr counter
	after 20
	update
    }
    if {$counter == 1000} {
	set result "file size only [file size $path(output)]"
    } else {
	set result ok
    }

---- Result was:
error deleting "C:/Documents and Settings/kennykb/My Documents/SourceForge/tcl/win/output": permission denied
---- Result should have been (exact matching):
ok
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== io-29.32 FAILED


==== io-46.1 Tcl event loop vs multiple interpreters FAILED
==== Contents of test case:

    testfevent create
    testfevent cmd [format {
        set f [open %s r]
        set x "no event"
        fileevent $f readable [namespace code {
            set x "f triggered: [gets $f]"
            fileevent $f readable {}
        }]
    } $path(foo)]
    after 1	;# We must delay because Windows takes a little time to notice
    update
    testfevent cmd {close $f}
    list [testfevent cmd {set x}] [testfevent cmd {info commands after}]

---- Result was:
wrong # args: should be "open fileName ?access? ?permissions?"
---- Result should have been (exact matching):
{f triggered: foo bar} after
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== io-46.1 FAILED