summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2002-07-01 02:29:21 (GMT)
committerdgp <dgp@users.sourceforge.net>2002-07-01 02:29:21 (GMT)
commitf211b4e55ee58981446b46e61f4702f72debe32a (patch)
tree4013ba176f77d97263c96b559735522ac72cf6c3 /tests
parent3778d78fa0369f91e4b2b4f0e502745be8eecb65 (diff)
downloadtcl-f211b4e55ee58981446b46e61f4702f72debe32a.zip
tcl-f211b4e55ee58981446b46e61f4702f72debe32a.tar.gz
tcl-f211b4e55ee58981446b46e61f4702f72debe32a.tar.bz2
* Fixed [makeFile] and [viewFile] to accurately reflect a file's
contents. Updated tests that depended on buggy behavior. Also added warning messages to "-debug 1" operations to debug test calls to (make|remove)(File|Directory).
Diffstat (limited to 'tests')
-rw-r--r--tests/cmdAH.test6
-rw-r--r--tests/event.test7
-rw-r--r--tests/http.test21
-rw-r--r--tests/io.test18
-rw-r--r--tests/iogt.test25
5 files changed, 32 insertions, 45 deletions
diff --git a/tests/cmdAH.test b/tests/cmdAH.test
index cb6b2e4..6d24820 100644
--- a/tests/cmdAH.test
+++ b/tests/cmdAH.test
@@ -10,10 +10,10 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: cmdAH.test,v 1.22 2002/06/27 12:27:35 vincentdarley Exp $
+# RCS: @(#) $Id: cmdAH.test,v 1.23 2002/07/01 02:29:22 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
- package require tcltest
+ package require tcltest 2.1
namespace import -force ::tcltest::*
}
@@ -1433,7 +1433,7 @@ test cmdAH-28.4 {Tcl_FileObjCmd: stat} {
catch {unset stat}
file stat gorp.file stat
list $stat(nlink) $stat(size) $stat(type)
-} {1 12 file}
+} {1 11 file}
test cmdAH-28.5 {Tcl_FileObjCmd: stat} {unixOnly} {
catch {unset stat}
file stat gorp.file stat
diff --git a/tests/event.test b/tests/event.test
index 8c26fee..9fa905d 100644
--- a/tests/event.test
+++ b/tests/event.test
@@ -9,10 +9,10 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: event.test,v 1.16 2002/06/22 04:19:47 dgp Exp $
+# RCS: @(#) $Id: event.test,v 1.17 2002/07/01 02:29:22 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
- package require tcltest 2
+ package require tcltest 2.1
namespace import -force ::tcltest::*
}
@@ -217,8 +217,7 @@ test event-6.1 {BgErrorDeleteProc procedure} {
close $f
removeFile err.out
set result
-} {Unmodified
-}
+} {Unmodified}
test event-7.1 {bgerror / regular} {
set errRes {}
diff --git a/tests/http.test b/tests/http.test
index cabfaed..fe76873 100644
--- a/tests/http.test
+++ b/tests/http.test
@@ -12,10 +12,10 @@
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
#
-# RCS: @(#) $Id: http.test,v 1.26 2002/06/22 04:19:47 dgp Exp $
+# RCS: @(#) $Id: http.test,v 1.27 2002/07/01 02:29:22 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
- package require tcltest
+ package require tcltest 2.1
namespace import -force ::tcltest::*
}
@@ -223,8 +223,8 @@ test http-3.11 {http::geturl querychannel with -command} {
append query $sep$query
set sep &
}
- ::tcltest::makeFile $query outdata
- set fp [open outdata]
+ set file [makeFile $query outdata]
+ set fp [open $file]
proc asyncCB {token} {
global postResult
@@ -238,14 +238,15 @@ test http-3.11 {http::geturl querychannel with -command} {
# Now do async
http::cleanup $t
close $fp
- set fp [open outdata]
+ set fp [open $file]
set t [http::geturl $posturl -querychannel $fp -command asyncCB]
set postResult [list PostStart]
http::wait $t
lappend testRes [http::status $t] $postResult
+ removeFile outdata
set testRes
-} {ok 122879 {Got 122880 bytes} ok {PostStart {Got 122880 bytes}}}
+} {ok 122879 {Got 122879 bytes} ok {PostStart {Got 122879 bytes}}}
# On Linux platforms when the client and server are on the same
# host, the client is unable to read the server's response one
@@ -264,8 +265,8 @@ test http-3.12 {http::geturl querychannel with aborted request} {nonPortable} {
append query $sep$query
set sep &
}
- ::tcltest::makeFile $query outdata
- set fp [open outdata]
+ set file [makeFile $query outdata]
+ set fp [open $file]
proc asyncCB {token} {
global postResult
@@ -288,6 +289,7 @@ test http-3.12 {http::geturl querychannel with aborted request} {nonPortable} {
error $err
}
+ removeFile outdata
list [http::status $t] [http::code $t]
} {ok {HTTP/1.0 200 Data follows}}
@@ -487,8 +489,5 @@ if {[info exists httpthread]} {
if {[info exist removeHttpd]} {
removeFile $httpdFile
}
-foreach file [list outdata] {
- catch {::tcltest::removeFile $file}
-}
::tcltest::cleanupTests
diff --git a/tests/io.test b/tests/io.test
index 067db18..973fd4e 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -12,10 +12,10 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: io.test,v 1.31 2002/06/06 18:44:43 dgp Exp $
+# RCS: @(#) $Id: io.test,v 1.32 2002/07/01 02:29:22 dgp Exp $
-if {[catch {package require tcltest 2}]} {
- puts stderr "Skipping tests in [info script]. tcltest 2 required."
+if {[catch {package require tcltest 2.1}]} {
+ puts stderr "Skipping tests in [info script]. tcltest 2.1 required."
return
}
namespace eval ::tcl::test::io {
@@ -4207,7 +4207,8 @@ test io-34.10 {Tcl_Seek testing flushing of buffered input} {
close $f
list $x [viewFile test3]
} "xyz {xyz
-456}"
+456
+}"
test io-34.11 {Tcl_Seek testing flushing of buffered output} {
set f [open test3 w]
puts $f xyz\n123
@@ -4218,7 +4219,8 @@ test io-34.11 {Tcl_Seek testing flushing of buffered output} {
set x [gets $f]
close $f
list $x [viewFile test3]
-} "zzy xyzzy"
+} "zzy {xyzzy
+}"
test io-34.12 {Tcl_Seek testing combination of write, seek back and read} {
set f [open test3 w]
fconfigure $f -translation lf -eofchar {}
@@ -4235,7 +4237,8 @@ test io-34.12 {Tcl_Seek testing combination of write, seek back and read} {
list $x [viewFile test3] $y
} {14 {xyz
123
-xyzzy} zzy}
+xyzzy
+} zzy}
test io-34.13 {Tcl_Tell at start of file} {
removeFile test1
set f1 [open test1 w]
@@ -5208,7 +5211,8 @@ test io-40.7 {POSIX open access modes: EXCL} {
puts $f "A test line"
close $f
viewFile test3
-} {A test line}
+} {A test line
+}
test io-40.8 {POSIX open access modes: TRUNC} {
removeFile test3
set f [open test3 w]
diff --git a/tests/iogt.test b/tests/iogt.test
index b083efb..fb3c326 100644
--- a/tests/iogt.test
+++ b/tests/iogt.test
@@ -10,10 +10,10 @@
# Copyright (c) 2000 Andreas Kupries.
# All rights reserved.
#
-# RCS: @(#) $Id: iogt.test,v 1.4 2002/04/17 23:03:14 dgp Exp $
+# RCS: @(#) $Id: iogt.test,v 1.5 2002/07/01 02:29:22 dgp Exp $
-if {[catch {package require tcltest 2}]} {
- puts stderr "Skipping tests in [info script]. tcltest 2 required."
+if {[catch {package require tcltest 2.1}]} {
+ puts stderr "Skipping tests in [info script]. tcltest 2.1 required."
return
}
namespace eval ::tcl::test::iogt {
@@ -486,7 +486,7 @@ test iogt-2.0 {basic I/O going through transform} testchannel {
close $fout
set res
-} {1 71 71}
+} {1 70 70}
test iogt-2.1 {basic I/O, operation trail} {testchannel unixOnly} {
@@ -522,8 +522,6 @@ read
query/maxRead
read
query/maxRead
-read
-query/maxRead
flush/read
delete/read
--------
@@ -535,7 +533,6 @@ write
write
write
write
-write
flush/write
delete/write}
@@ -572,10 +569,6 @@ read {\}\{`~!@#$} {\}\{`~!@#$}
query/maxRead {} -1
read %^&*()_+-= %^&*()_+-=
query/maxRead {} -1
-read {
-} {
-}
-query/maxRead {} -1
flush/read {} {}
delete/read {} *ignored*
--------
@@ -587,9 +580,6 @@ write 456789,./? 456789,./?
write {><;'\|":[]} {><;'\|":[]}
write {\}\{`~!@#$} {\}\{`~!@#$}
write %^&*()_+-= %^&*()_+-=
-write {
-} {
-}
flush/write {} {}
delete/write {} *ignored*}
@@ -626,15 +616,10 @@ read {><;'\|":[]\}\{`~!@#$} {><;'\|":[]\}\{`~!@#$}
write {><;'\|":[]} {><;'\|":[]}
write {\}\{`~!@#$} {\}\{`~!@#$}
query/maxRead {} -1
-read {%^&*()_+-=
-} {%^&*()_+-=
-}
+read %^&*()_+-= %^&*()_+-=
query/maxRead {} -1
flush/read {} {}
write %^&*()_+-= %^&*()_+-=
-write {
-} {
-}
delete/read {} *ignored*
flush/write {} {}
delete/write {} *ignored*}