summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-14 09:39:09 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-14 09:39:09 (GMT)
commitd0cfe30a0d61b7b9fe957c29c73ea5aa1d9f8310 (patch)
tree7bb450068eb4efbc3969ba8fff1e0a991137f3b9
parent5bef31d2da2eb4ed8f3261ef8276cb2a3b6f3a1e (diff)
parentf0ec68f07293dac2b967d45a3697073b77688970 (diff)
downloadtcl-d0cfe30a0d61b7b9fe957c29c73ea5aa1d9f8310.zip
tcl-d0cfe30a0d61b7b9fe957c29c73ea5aa1d9f8310.tar.gz
tcl-d0cfe30a0d61b7b9fe957c29c73ea5aa1d9f8310.tar.bz2
Merge 8.6
-rw-r--r--tests/chan.test2
-rw-r--r--tests/http11.test2
-rw-r--r--tests/httpTest.tcl10
-rw-r--r--tests/httpd11.tcl2
-rw-r--r--tests/obj.test2
-rw-r--r--tests/reg.test2
-rw-r--r--tests/socket.test2
-rw-r--r--tests/stringObj.test4
-rw-r--r--tests/thread.test4
-rw-r--r--tests/unload.test4
-rw-r--r--tools/mkdepend.tcl2
-rw-r--r--tools/uniParse.tcl4
12 files changed, 20 insertions, 20 deletions
diff --git a/tests/chan.test b/tests/chan.test
index 2ca0142..5d05935 100644
--- a/tests/chan.test
+++ b/tests/chan.test
@@ -173,7 +173,7 @@ test chan-16.9 {chan command: pending input subcommand} -setup {
lappend ::chan-16.9-data $r $l $e $b $i
- if {$r != -1 || $e || $l || !$b || $i > 128} {
+ if {$r >= 0 || $e || $l || !$b || $i > 128} {
set data [read $sock $i]
lappend ::chan-16.9-data [string range $data 0 2]
lappend ::chan-16.9-data [string range $data end-2 end]
diff --git a/tests/http11.test b/tests/http11.test
index 7ca57f4..f243e56 100644
--- a/tests/http11.test
+++ b/tests/http11.test
@@ -19,7 +19,7 @@ variable httpd_output
proc create_httpd {} {
proc httpd_read {chan} {
variable httpd_output
- if {[gets $chan line] != -1} {
+ if {[gets $chan line] >= 0} {
#puts stderr "read '$line'"
set httpd_output $line
}
diff --git a/tests/httpTest.tcl b/tests/httpTest.tcl
index 7491fb4..8a96d95 100644
--- a/tests/httpTest.tcl
+++ b/tests/httpTest.tcl
@@ -60,7 +60,7 @@ proc http::Log {args} {
variable TestStartTimeInMs
set time [expr {[clock milliseconds] - $TestStartTimeInMs}]
set txt [list $time {*}$args]
- if {[string first ^ $txt] != -1} {
+ if {[string first ^ $txt] >= 0} {
::httpTest::LogRecord $txt
::httpTest::Puts $txt
} elseif {$::httpTest::testOptions(-verbose) > 1} {
@@ -86,7 +86,7 @@ proc httpTest::LogRecord {txt} {
puts stdout "Fix this call to Log in http-*.tm so it has ^ then\
a letter then a numeral."
flush stdout
- } elseif {$pos == -1} {
+ } elseif {$pos < 0} {
# Called by mistake.
} else {
set letter [string index $txt [incr pos]]
@@ -374,7 +374,7 @@ proc httpTest::ProcessRetries {someResults n msg skipOverlaps notIncluded notPip
variable testOptions
set nextRetry [lsearch -glob -index 0 $someResults {[PQR]}]
- if {$nextRetry == -1} {
+ if {$nextRetry < 0} {
return [MostAnalysis $someResults $n $msg $skipOverlaps $notIncluded $notPiped]
}
set badTrans $notIncluded
@@ -391,7 +391,7 @@ proc httpTest::ProcessRetries {someResults n msg skipOverlaps notIncluded notPip
for {set i 1} {$i <= $n} {incr i} {
set first [lsearch -exact $beforeTry [list A $i]]
set last [lsearch -exact $beforeTry [list F $i]]
- if {$first == -1} {
+ if {$first < 0} {
set res "Transaction $i was not started in connection number $tryCount"
# So lappend it to badTrans and don't include it in the call below of MostAnalysis.
# append msg $res \n
@@ -400,7 +400,7 @@ proc httpTest::ProcessRetries {someResults n msg skipOverlaps notIncluded notPip
lappend badTrans $i
} else {
}
- } elseif {$last == -1} {
+ } elseif {$last < 0} {
set res "Transaction $i was started but unfinished in connection number $tryCount"
# So lappend it to badTrans and don't include it in the call below of MostAnalysis.
# append msg $res \n
diff --git a/tests/httpd11.tcl b/tests/httpd11.tcl
index 0b02319..89590ec 100644
--- a/tests/httpd11.tcl
+++ b/tests/httpd11.tcl
@@ -237,7 +237,7 @@ proc Accept {chan addr port} {
}
proc Control {chan} {
- if {[gets $chan line] != -1} {
+ if {[gets $chan line] >= 0} {
if {[string trim $line] eq "quit"} {
set ::forever 1
}
diff --git a/tests/obj.test b/tests/obj.test
index 8a74a05..e10cebf 100644
--- a/tests/obj.test
+++ b/tests/obj.test
@@ -34,7 +34,7 @@ test obj-1.1 {Tcl_AppendAllObjTypes, and InitTypeTable, Tcl_RegisterObjType} tes
string
} {
set first [string first $t [testobj types]]
- set r [expr {$r && ($first != -1)}]
+ set r [expr {$r && ($first >= 0)}]
}
set result $r
} {1}
diff --git a/tests/reg.test b/tests/reg.test
index 4b65503..847da32 100644
--- a/tests/reg.test
+++ b/tests/reg.test
@@ -288,7 +288,7 @@ namespace eval RETest {
set infoflags [TestInfoFlags $flags]
set ccmd [list testregexp -about {*}$f $re]
set nsub [expr {[llength $args] - 1}]
- if {$nsub == -1} {
+ if {$nsub < 0} {
# didn't tell us number of subexps
set ccmd "lreplace \[$ccmd\] 0 0"
set info [list $infoflags]
diff --git a/tests/socket.test b/tests/socket.test
index ee954d6..868c17a 100644
--- a/tests/socket.test
+++ b/tests/socket.test
@@ -248,7 +248,7 @@ if {$doTestsWithRemoteServer} {
# Some tests are run only if we are doing testing against a remote server.
testConstraint doTestsWithRemoteServer $doTestsWithRemoteServer
if {!$doTestsWithRemoteServer} {
- if {[string first s $::tcltest::verbose] != -1} {
+ if {[string first s $::tcltest::verbose] >= 0} {
puts "Skipping tests with remote server. See tests/socket.test for"
puts "information on how to run remote server."
puts "Reason for not doing remote tests: $noRemoteTestReason"
diff --git a/tests/stringObj.test b/tests/stringObj.test
index ffac622..ca6c323 100644
--- a/tests/stringObj.test
+++ b/tests/stringObj.test
@@ -29,8 +29,8 @@ testConstraint nodep [info exists tcl_precision]
test stringObj-1.1 {string type registration} testobj {
set t [testobj types]
set first [string first "string" $t]
- set result [expr {$first != -1}]
-} {1}
+ set result [expr {$first >= 0}]
+} 1
test stringObj-2.1 {Tcl_NewStringObj} testobj {
set result ""
diff --git a/tests/thread.test b/tests/thread.test
index 0a12285..0a35d1b 100644
--- a/tests/thread.test
+++ b/tests/thread.test
@@ -39,11 +39,11 @@ set threadSuperKillScript {
proc getThreadErrorFromInfo { info } {
set list [split $info \n]
set idx [lsearch -glob $list "*eval*unwound*"]
- if {$idx != -1} then {
+ if {$idx >= 0} then {
return [lindex $list $idx]
}
set idx [lsearch -glob $list "*eval*canceled*"]
- if {$idx != -1} then {
+ if {$idx >= 0} then {
return [lindex $list $idx]
}
return ""; # some other error we do not care about.
diff --git a/tests/unload.test b/tests/unload.test
index 05a0104..815ff31 100644
--- a/tests/unload.test
+++ b/tests/unload.test
@@ -156,14 +156,14 @@ test unload-3.3 {unloading of a package that has never been loaded from a safe i
unload [file join $testDir pkga$ext] {} child
} -result {file "*" has never been loaded in this interpreter}
test unload-3.4 {basic unloading of a non-unloadable package from a safe interpreter, with guess for package name} -setup {
- if {[lsearch -index 1 [info loaded child] Pkgb] == -1} {
+ if {[lsearch -index 1 [info loaded child] Pkgb] < 0} {
load [file join $testDir pkgb$ext] pKgB child
}
} -constraints [list $dll $loaded] -returnCodes error -match glob -body {
unload [file join $testDir pkgb$ext] {} child
} -result {file "*" cannot be unloaded under a safe interpreter}
test unload-3.5 {basic unloading of an unloadable package from a safe interpreter, with guess for package name} -setup {
- if {[lsearch -index 1 [info loaded child] Pkgua] == -1} {
+ if {[lsearch -index 1 [info loaded child] Pkgua] < 0} {
load [file join $testDir pkgua$ext] pkgua child
}
} -constraints [list $dll $loaded] -body {
diff --git a/tools/mkdepend.tcl b/tools/mkdepend.tcl
index 3d96a5e..b1ad076 100644
--- a/tools/mkdepend.tcl
+++ b/tools/mkdepend.tcl
@@ -88,7 +88,7 @@ proc readDepends {chan} {
set line ""
array set depends {}
- while {[gets $chan line] != -1} {
+ while {[gets $chan line] >= 0} {
if {[regexp {^#line [0-9]+ \"(.*)\"$} $line dummy fname] != 0} {
set fname [file normalize $fname]
if {![info exists target]} {
diff --git a/tools/uniParse.tcl b/tools/uniParse.tcl
index a451096..545afc4 100644
--- a/tools/uniParse.tcl
+++ b/tools/uniParse.tcl
@@ -68,7 +68,7 @@ proc uni::getGroup {value} {
variable groups
set gIndex [lsearch -exact $groups $value]
- if {$gIndex == -1} {
+ if {$gIndex < 0} {
set gIndex [llength $groups]
lappend groups $value
}
@@ -81,7 +81,7 @@ proc uni::addPage {info} {
variable shift
set pIndex [lsearch -exact $pages $info]
- if {$pIndex == -1} {
+ if {$pIndex < 0} {
set pIndex [llength $pages]
lappend pages $info
}