diff options
Diffstat (limited to 'tests/iogt.test')
-rw-r--r-- | tests/iogt.test | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/tests/iogt.test b/tests/iogt.test index fbefa12..2494b91 100644 --- a/tests/iogt.test +++ b/tests/iogt.test @@ -10,7 +10,7 @@ # Copyright (c) 2000 Andreas Kupries. # All rights reserved. # -# RCS: @(#) $Id: iogt.test,v 1.6 2002/07/01 03:04:55 dgp Exp $ +# RCS: @(#) $Id: iogt.test,v 1.7 2002/07/04 15:46:55 andreas_kupries Exp $ if {[catch {package require tcltest 2.1}]} { puts stderr "Skipping tests in [info script]. tcltest 2.1 required." @@ -26,14 +26,14 @@ namespace eval ::tcl::test::iogt { testConstraint testchannel [llength [info commands testchannel]] -makeFile {abcdefghijklmnopqrstuvwxyz0123456789,./?><;'\|":[]\}\{`~!@#$%^&*()_+-= -} dummy +set path(dummy) [makeFile {abcdefghijklmnopqrstuvwxyz0123456789,./?><;'\|":[]\}\{`~!@#$%^&*()_+-= +} dummy] # " capture coloring of quotes -makeFile {} dummyout +set path(dummyout) [makeFile {} dummyout] -makeFile { +set path(__echo_srv__.tcl) [makeFile { #!/usr/local/bin/tclsh # -*- tcl -*- # echo server @@ -133,7 +133,7 @@ proc echoPut {c sock} { # main socket -server newconn $port vwait forever -} __echo_srv__.tcl +} __echo_srv__.tcl] ######################################################################## @@ -411,22 +411,21 @@ proc asort {alist} { ######################################################################## - test iogt-1.1 {stack/unstack} testchannel { - set fh [open dummy r] + set fh [open $path(dummy) r] identity -attach $fh testchannel unstack $fh close $fh } {} test iogt-1.2 {stack/close} testchannel { - set fh [open dummy r] + set fh [open $path(dummy) r] identity -attach $fh close $fh } {} test iogt-1.3 {stack/unstack, configuration, options} testchannel { - set fh [open dummy r] + set fh [open $path(dummy) r] set ca [asort [fconfigure $fh]] identity -attach $fh set cb [asort [fconfigure $fh]] @@ -444,7 +443,7 @@ test iogt-1.3 {stack/unstack, configuration, options} testchannel { } {1 1 1} test iogt-1.4 {stack/unstack, configuration} testchannel { - set fh [open dummy r] + set fh [open $path(dummy) r] set ca [asort [fconfigure $fh]] identity -attach $fh fconfigure $fh \ @@ -466,8 +465,8 @@ test iogt-1.4 {stack/unstack, configuration} testchannel { } {0 line cr shiftjis} test iogt-2.0 {basic I/O going through transform} testchannel { - set fin [open dummy r] - set fout [open dummyout w] + set fin [open $path(dummy) r] + set fout [open $path(dummyout) w] identity -attach $fin identity -attach $fout @@ -477,8 +476,8 @@ test iogt-2.0 {basic I/O going through transform} testchannel { close $fin close $fout - set fin [open dummy r] - set fout [open dummyout r] + set fin [open $path(dummy) r] + set fout [open $path(dummyout) r] set res [string equal [set in [read $fin]] [set out [read $fout]]] lappend res [string length $in] [string length $out] @@ -491,8 +490,8 @@ test iogt-2.0 {basic I/O going through transform} testchannel { test iogt-2.1 {basic I/O, operation trail} {testchannel unixOnly} { - set fin [open dummy r] - set fout [open dummyout w] + set fin [open $path(dummy) r] + set fout [open $path(dummyout) w] set ain [list] ; set aout [list] audit_ops ain -attach $fin @@ -541,8 +540,8 @@ flush/write delete/write} test iogt-2.2 {basic I/O, data trail} {testchannel unixOnly} { - set fin [open dummy r] - set fout [open dummyout w] + set fin [open $path(dummy) r] + set fout [open $path(dummyout) w] set ain [list] ; set aout [list] audit_flow ain -attach $fin @@ -596,8 +595,8 @@ delete/write {} *ignored*} test iogt-2.3 {basic I/O, mixed trail} {testchannel unixOnly} { - set fin [open dummy r] - set fout [open dummyout w] + set fin [open $path(dummy) r] + set fout [open $path(dummyout) w] set trail [list] audit_flow trail -attach $fin @@ -656,7 +655,7 @@ test iogt-3.0 {Tcl_Channel valid after stack/unstack, fevent handling} \ variable copy ; set copy 1 } - set fin [open dummy r] + set fin [open $path(dummy) r] fevent 1000 500 {20 20 20 10 1 1} { close $fin @@ -684,8 +683,8 @@ test iogt-3.0 {Tcl_Channel valid after stack/unstack, fevent handling} \ # Check result of copy. - set fin [open dummy r] - set fout [open dummyout r] + set fin [open $path(dummy) r] + set fout [open $path(dummyout) r] set res [string equal [read $fin] [read $fout]] @@ -697,7 +696,7 @@ test iogt-3.0 {Tcl_Channel valid after stack/unstack, fevent handling} \ test iogt-4.0 {fileevent readable, after transform} {testchannel unknownFailure} { - set fin [open dummy r] + set fin [open $path(dummy) r] set data [read $fin] close $fin @@ -828,8 +827,8 @@ delete/read {} *ignored*} ; # catch unescaped quote " test iogt-5.0 {EOF simulation} {testchannel unknownFailure} { - set fin [open dummy r] - set fout [open dummyout w] + set fin [open $path(dummy) r] + set fout [open $path(dummyout) w] set trail [list] @@ -907,7 +906,7 @@ proc constx {-attach channel} { } test iogt-6.0 {Push back} testchannel { - set f [open dummy r] + set f [open $path(dummy) r] # contents of dummy = "abcdefghi..." read $f 3 ; # skip behind "abc" @@ -928,7 +927,7 @@ test iogt-6.0 {Push back} testchannel { } {xxx} test iogt-6.1 {Push back and up} {testchannel knownBug} { - set f [open dummy r] + set f [open $path(dummy) r] # contents of dummy = "abcdefghi..." read $f 3 ; # skip behind "abc" |