Skip to content

Commit 13c4884

Browse files
author
jan.nijtmans
committed
Merge 8.6
2 parents e324e21 + 83f6c2c commit 13c4884

File tree

7 files changed

+92
-91
lines changed

7 files changed

+92
-91
lines changed

doc/tcltest.n

+1-1
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ denormalized or improperly formed strings to pass to C procedures that
466466
are supposed to accept strings with embedded NULL types and confirm
467467
that a string result has a certain pattern of bytes. This is
468468
exactly equivalent to the Tcl command \fBencoding convertfrom\fR
469-
\fBidentity\fR.
469+
\fBidentity\fR. This function is deprecated.
470470
.SH TESTS
471471
.PP
472472
The \fBtest\fR command is the heart of the \fBtcltest\fR package.

library/manifest.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ apply {{dir} {
1111
0 tcl::idna 1.0.1 {cookiejar idna.tcl}
1212
0 platform 1.0.19 {platform platform.tcl}
1313
0 platform::shell 1.1.4 {platform shell.tcl}
14-
1 tcltest 2.5.8 {tcltest tcltest.tcl}
14+
1 tcltest 2.5.9 {tcltest tcltest.tcl}
1515
} {
1616
if {$isafe && !$safe} continue
1717
package ifneeded $package $version [list source [file join $dir {*}$file]]

library/tcltest/pkgIndex.tcl

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
# full path name of this file's directory.
1010

1111
if {![package vsatisfies [package provide Tcl] 8.5-]} {return}
12-
package ifneeded tcltest 2.5.8 [list source -encoding utf-8 [file join $dir tcltest.tcl]]
12+
package ifneeded tcltest 2.5.9 [list source -encoding utf-8 [file join $dir tcltest.tcl]]

library/tcltest/tcltest.tcl

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace eval tcltest {
2121
# When the version number changes, be sure to update the pkgIndex.tcl file,
2222
# and the install directory in the Makefiles. When the minor version
2323
# changes (new feature) be sure to update the man page as well.
24-
variable Version 2.5.8
24+
variable Version 2.5.9
2525

2626
# Compatibility support for dumb variables defined in tcltest 1
2727
# Do not use these. Call [package require] and [info patchlevel]
@@ -43,7 +43,7 @@ namespace eval tcltest {
4343
outputChannel testConstraint
4444

4545
# Export commands that are duplication (candidates for deprecation)
46-
if {!$fullutf} {
46+
if {![package vsatisfies [package provide Tcl] 9.0-]} {
4747
namespace export bytestring ;# dups [encoding convertfrom identity]
4848
}
4949
namespace export debug ;# [configure -debug]
@@ -3342,7 +3342,7 @@ proc tcltest::viewFile {name {directory ""}} {
33423342
# Side effects:
33433343
# None
33443344

3345-
if {!$::tcltest::fullutf} {
3345+
if {![package vsatisfies [package provide Tcl] 9.0-]} {
33463346
proc tcltest::bytestring {string} {
33473347
return [encoding convertfrom identity $string]
33483348
}

tests/string.test

+82-81
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ test string-3.45f.$noComp {string equal -nocase empty string against byte array}
432432
run {string equal -nocase [binary decode hex 00] ""}
433433
} 0
434434

435+
435436
test string-4.1.$noComp {string first, not enough args} {
436437
list [catch {run {string first a}} msg] $msg
437438
} {1 {wrong # args: should be "string first needleString haystackString ?startIndex?"}}
@@ -2072,47 +2073,47 @@ test string-23.0.$noComp {string is boolean, Bug 1187123} testindexobj {
20722073
test string-23.1.$noComp {string is command with empty string} {
20732074
set s ""
20742075
list \
2075-
[run {string is alnum $s}] \
2076-
[run {string is alpha $s}] \
2077-
[run {string is ascii $s}] \
2078-
[run {string is control $s}] \
2079-
[run {string is boolean $s}] \
2080-
[run {string is digit $s}] \
2081-
[run {string is double $s}] \
2082-
[run {string is false $s}] \
2083-
[run {string is graph $s}] \
2084-
[run {string is integer $s}] \
2085-
[run {string is lower $s}] \
2086-
[run {string is print $s}] \
2087-
[run {string is punct $s}] \
2088-
[run {string is space $s}] \
2089-
[run {string is true $s}] \
2090-
[run {string is upper $s}] \
2091-
[run {string is wordchar $s}] \
2092-
[run {string is xdigit $s}] \
2076+
[run {string is alnum $s}] \
2077+
[run {string is alpha $s}] \
2078+
[run {string is ascii $s}] \
2079+
[run {string is control $s}] \
2080+
[run {string is boolean $s}] \
2081+
[run {string is digit $s}] \
2082+
[run {string is double $s}] \
2083+
[run {string is false $s}] \
2084+
[run {string is graph $s}] \
2085+
[run {string is integer $s}] \
2086+
[run {string is lower $s}] \
2087+
[run {string is print $s}] \
2088+
[run {string is punct $s}] \
2089+
[run {string is space $s}] \
2090+
[run {string is true $s}] \
2091+
[run {string is upper $s}] \
2092+
[run {string is wordchar $s}] \
2093+
[run {string is xdigit $s}] \
20932094

20942095
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1}
20952096
test string-23.2.$noComp {string is command with empty string} {
20962097
set s ""
20972098
list \
2098-
[run {string is alnum -strict $s}] \
2099-
[run {string is alpha -strict $s}] \
2100-
[run {string is ascii -strict $s}] \
2101-
[run {string is control -strict $s}] \
2102-
[run {string is boolean -strict $s}] \
2103-
[run {string is digit -strict $s}] \
2104-
[run {string is double -strict $s}] \
2105-
[run {string is false -strict $s}] \
2106-
[run {string is graph -strict $s}] \
2107-
[run {string is integer -strict $s}] \
2108-
[run {string is lower -strict $s}] \
2109-
[run {string is print -strict $s}] \
2110-
[run {string is punct -strict $s}] \
2111-
[run {string is space -strict $s}] \
2112-
[run {string is true -strict $s}] \
2113-
[run {string is upper -strict $s}] \
2114-
[run {string is wordchar -strict $s}] \
2115-
[run {string is xdigit -strict $s}] \
2099+
[run {string is alnum -strict $s}] \
2100+
[run {string is alpha -strict $s}] \
2101+
[run {string is ascii -strict $s}] \
2102+
[run {string is control -strict $s}] \
2103+
[run {string is boolean -strict $s}] \
2104+
[run {string is digit -strict $s}] \
2105+
[run {string is double -strict $s}] \
2106+
[run {string is false -strict $s}] \
2107+
[run {string is graph -strict $s}] \
2108+
[run {string is integer -strict $s}] \
2109+
[run {string is lower -strict $s}] \
2110+
[run {string is print -strict $s}] \
2111+
[run {string is punct -strict $s}] \
2112+
[run {string is space -strict $s}] \
2113+
[run {string is true -strict $s}] \
2114+
[run {string is upper -strict $s}] \
2115+
[run {string is wordchar -strict $s}] \
2116+
[run {string is xdigit -strict $s}] \
21162117

21172118
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
21182119

@@ -2283,12 +2284,12 @@ test string-26.10.$noComp {tcl::prefix} -body {
22832284
} -returnCodes 2 -result {ambiguous option "be": must be apa, bepa, bear, or depa}
22842285
test string-26.10.1.$noComp {tcl::prefix} -setup {
22852286
proc _testprefix {args} {
2286-
array set opts {-a x -b y -c y}
2287-
foreach {opt val} $args {
2288-
set opt [tcl::prefix match -error {-level 1} {-a -b -c} $opt]
2289-
set opts($opt) $val
2290-
}
2291-
array get opts
2287+
array set opts {-a x -b y -c y}
2288+
foreach {opt val} $args {
2289+
set opt [tcl::prefix match -error {-level 1} {-a -b -c} $opt]
2290+
set opts($opt) $val
2291+
}
2292+
array get opts
22922293
}
22932294
} -body {
22942295
set a [catch {_testprefix -x u} result options]
@@ -2304,37 +2305,37 @@ test string-26.10.1.$noComp {tcl::prefix} -setup {
23042305
proc MemStress {args} {
23052306
set res {}
23062307
foreach body $args {
2307-
set end 0
2308-
for {set i 0} {$i < 5} {incr i} {
2309-
proc MemStress_Body {} $body
2310-
uplevel 1 MemStress_Body
2311-
rename MemStress_Body {}
2312-
set tmp $end
2313-
set end [lindex [lindex [split [memory info] "\n"] 3] 3]
2314-
}
2315-
lappend res [expr {$end - $tmp}]
2308+
set end 0
2309+
for {set i 0} {$i < 5} {incr i} {
2310+
proc MemStress_Body {} $body
2311+
uplevel 1 MemStress_Body
2312+
rename MemStress_Body {}
2313+
set tmp $end
2314+
set end [lindex [lindex [split [memory info] "\n"] 3] 3]
2315+
}
2316+
lappend res [expr {$end - $tmp}]
23162317
}
23172318
return $res
23182319
}
23192320

23202321
test string-26.11.$noComp {tcl::prefix: testing for leaks} -body {
23212322
# This test is made to stress object reference management
23222323
MemStress {
2323-
set table {hejj miff gurk}
2324-
set item [lindex $table 1]
2325-
# If not careful, this can cause a circular reference
2326-
# that will cause a leak.
2327-
tcl::prefix match $table $item
2324+
set table {hejj miff gurk}
2325+
set item [lindex $table 1]
2326+
# If not careful, this can cause a circular reference
2327+
# that will cause a leak.
2328+
tcl::prefix match $table $item
23282329
} {
2329-
# A similar case with nested lists
2330-
set table2 {hejj {miff maff} gurk}
2331-
set item [lindex [lindex $table2 1] 0]
2332-
tcl::prefix match $table2 $item
2330+
# A similar case with nested lists
2331+
set table2 {hejj {miff maff} gurk}
2332+
set item [lindex [lindex $table2 1] 0]
2333+
tcl::prefix match $table2 $item
23332334
} {
2334-
# A similar case with dict
2335-
set table3 {hejj {miff maff} gurk2}
2336-
set item [lindex [dict keys [lindex $table3 1]] 0]
2337-
tcl::prefix match $table3 $item
2335+
# A similar case with dict
2336+
set table3 {hejj {miff maff} gurk2}
2337+
set item [lindex [dict keys [lindex $table3 1]] 0]
2338+
tcl::prefix match $table3 $item
23382339
}
23392340
} -constraints memory -result {0 0 0}
23402341

@@ -2343,29 +2344,29 @@ test string-26.12.$noComp {tcl::prefix: testing for leaks} -body {
23432344
# in real code. The shared literal "miff" causes a connection
23442345
# between the item and the table.
23452346
MemStress {
2346-
proc stress1 {item} {
2347-
set table [list hejj miff gurk]
2348-
tcl::prefix match $table $item
2349-
}
2350-
proc stress2 {} {
2351-
stress1 miff
2352-
}
2353-
stress2
2354-
rename stress1 {}
2355-
rename stress2 {}
2347+
proc stress1 {item} {
2348+
set table [list hejj miff gurk]
2349+
tcl::prefix match $table $item
2350+
}
2351+
proc stress2 {} {
2352+
stress1 miff
2353+
}
2354+
stress2
2355+
rename stress1 {}
2356+
rename stress2 {}
23562357
}
23572358
} -constraints memory -result 0
23582359

23592360
test string-26.13.$noComp {tcl::prefix: testing for leaks} -body {
23602361
# This test is made to stress object reference management
23612362
MemStress {
2362-
set table [list hejj miff]
2363-
set item $table
2364-
set error $table
2365-
# Use the same objects in all places
2366-
catch {
2367-
tcl::prefix match -error $error $table $item
2368-
}
2363+
set table [list hejj miff]
2364+
set item $table
2365+
set error $table
2366+
# Use the same objects in all places
2367+
catch {
2368+
tcl::prefix match -error $error $table $item
2369+
}
23692370
}
23702371
} -constraints memory -result {0}
23712372

unix/Makefile.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -1081,9 +1081,9 @@ install-libraries: libraries
10811081
@echo "Installing package msgcat 1.7.1 as a Tcl Module"
10821082
@$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl \
10831083
"$(MODULE_INSTALL_DIR)/8.7/msgcat-1.7.1.tm"
1084-
@echo "Installing package tcltest 2.5.8 as a Tcl Module"
1084+
@echo "Installing package tcltest 2.5.9 as a Tcl Module"
10851085
@$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl \
1086-
"$(MODULE_INSTALL_DIR)/8.5/tcltest-2.5.8.tm"
1086+
"$(MODULE_INSTALL_DIR)/8.5/tcltest-2.5.9.tm"
10871087
@echo "Installing package platform 1.0.19 as a Tcl Module"
10881088
@$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl \
10891089
"$(MODULE_INSTALL_DIR)/8.4/platform-1.0.19.tm"

win/Makefile.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -916,8 +916,8 @@ install-libraries: libraries install-tzdata install-msgs
916916
done;
917917
@echo "Installing package msgcat 1.7.1 as a Tcl Module";
918918
@$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl "$(MODULE_INSTALL_DIR)/8.7/msgcat-1.7.1.tm";
919-
@echo "Installing package tcltest 2.5.8 as a Tcl Module";
920-
@$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl "$(MODULE_INSTALL_DIR)/8.5/tcltest-2.5.8.tm";
919+
@echo "Installing package tcltest 2.5.9 as a Tcl Module";
920+
@$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl "$(MODULE_INSTALL_DIR)/8.5/tcltest-2.5.9.tm";
921921
@echo "Installing package platform 1.0.19 as a Tcl Module";
922922
@$(COPY) $(ROOT_DIR)/library/platform/platform.tcl "$(MODULE_INSTALL_DIR)/8.4/platform-1.0.19.tm";
923923
@echo "Installing package platform::shell 1.1.4 as a Tcl Module";

0 commit comments

Comments
 (0)