summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-18 08:52:25 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-18 08:52:25 (GMT)
commitcb121886a41b47d26c93280c3f125819b5ed55d5 (patch)
tree05a1ff680d5a72080026dec1396b321c713f0255 /library
parent036b676c8b7295e2aa9324344d0ec1529ebb74ba (diff)
parent278b807336757abd553f464b172b6d751f92b3c9 (diff)
downloadtcl-cb121886a41b47d26c93280c3f125819b5ed55d5.zip
tcl-cb121886a41b47d26c93280c3f125819b5ed55d5.tar.gz
tcl-cb121886a41b47d26c93280c3f125819b5ed55d5.tar.bz2
Merge 8.7
Diffstat (limited to 'library')
-rw-r--r--library/tcltest/tcltest.tcl23
1 files changed, 13 insertions, 10 deletions
diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl
index 6cb7d92..278a4e0 100644
--- a/library/tcltest/tcltest.tcl
+++ b/library/tcltest/tcltest.tcl
@@ -400,7 +400,7 @@ namespace eval tcltest {
default {
set outputChannel [open $filename a]
if {[package vsatisfies [package provide Tcl] 8.7-]} {
- fconfigure $outputChannel -encoding utf-8
+ fconfigure $outputChannel -profile tcl8 -encoding utf-8
}
set ChannelsWeOpened($outputChannel) 1
@@ -447,7 +447,7 @@ namespace eval tcltest {
default {
set errorChannel [open $filename a]
if {[package vsatisfies [package provide Tcl] 8.7-]} {
- fconfigure $errorChannel -encoding utf-8
+ fconfigure $errorChannel -profile tcl8 -encoding utf-8
}
set ChannelsWeOpened($errorChannel) 1
@@ -792,7 +792,7 @@ namespace eval tcltest {
if {$Option(-loadfile) eq {}} {return}
set tmp [open $Option(-loadfile) r]
if {[package vsatisfies [package provide Tcl] 8.7-]} {
- fconfigure $tmp -encoding utf-8
+ fconfigure $tmp -profile tcl8 -encoding utf-8
}
loadScript [read $tmp]
close $tmp
@@ -1134,7 +1134,6 @@ proc tcltest::SafeFetch {n1 n2 op} {
}
}
-
# tcltest::Asciify --
#
# Transforms the passed string to contain only printable ascii characters.
@@ -1373,7 +1372,7 @@ proc tcltest::DefineConstraintInitializers {} {
set code 0
if {![catch {set f [open "|[list [interpreter]]" w]}]} {
if {[package vsatisfies [package provide Tcl] 8.7-]} {
- fconfigure $f -encoding utf-8
+ fconfigure $f -profile tcl8 -encoding utf-8
}
if {![catch {puts $f exit}]} {
if {![catch {close $f}]} {
@@ -2223,7 +2222,7 @@ proc tcltest::test {name description args} {
if {[file readable $testFile]} {
set testFd [open $testFile r]
if {[package vsatisfies [package provide Tcl] 8.7-]} {
- fconfigure $testFd -encoding utf-8
+ fconfigure $testFd -profile tcl8 -encoding utf-8
}
set testLine [expr {[lsearch -regexp \
[split [read $testFd] "\n"] \
@@ -2254,7 +2253,11 @@ proc tcltest::test {name description args} {
if {$scriptCompare} {
puts [outputChannel] "---- Error testing result: $scriptMatch"
} else {
- puts [outputChannel] "---- Result was:\n[Asciify $actualAnswer]"
+ if {[catch {
+ puts [outputChannel] "---- Result was:\n[Asciify $actualAnswer]"
+ } errMsg]} {
+ puts [outputChannel] "\n---- Result was:\n<error printing result: $errMsg>"
+ }
puts [outputChannel] "---- Result should have been\
($match matching):\n[Asciify $result]"
}
@@ -2934,7 +2937,7 @@ proc tcltest::runAllTests { {shell ""} } {
incr numTestFiles
set pipeFd [open $cmd "r"]
if {[package vsatisfies [package provide Tcl] 8.7-]} {
- fconfigure $pipeFd -encoding utf-8
+ fconfigure $pipeFd -profile tcl8 -encoding utf-8
}
while {[gets $pipeFd line] >= 0} {
if {[regexp [join {
@@ -3134,7 +3137,7 @@ proc tcltest::makeFile {contents name {directory ""}} {
set fd [open $fullName w]
fconfigure $fd -translation lf
if {[package vsatisfies [package provide Tcl] 8.7-]} {
- fconfigure $fd -encoding utf-8
+ fconfigure $fd -profile tcl8 -encoding utf-8
}
if {[string index $contents end] eq "\n"} {
puts -nonewline $fd $contents
@@ -3285,7 +3288,7 @@ proc tcltest::viewFile {name {directory ""}} {
set fullName [file join $directory $name]
set f [open $fullName]
if {[package vsatisfies [package provide Tcl] 8.7-]} {
- fconfigure $f -encoding utf-8
+ fconfigure $f -profile tcl8 -encoding utf-8
}
set data [read -nonewline $f]
close $f