diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-12-04 10:31:43 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-12-04 10:31:43 (GMT) |
commit | 0cdd87c215b27bd82bd9c250719eb471b8209911 (patch) | |
tree | 173f4f8c36fe9c472d4c66e62f26d8cb119e33b7 /library | |
parent | 25084dcd33f266a26bce646b6388334fe6ef6127 (diff) | |
parent | cd48044e1b95257568e26686e58e9c293a81a82d (diff) | |
download | tcl-0cdd87c215b27bd82bd9c250719eb471b8209911.zip tcl-0cdd87c215b27bd82bd9c250719eb471b8209911.tar.gz tcl-0cdd87c215b27bd82bd9c250719eb471b8209911.tar.bz2 |
Merge 8.5 (syncing "tcltest" package). Use more uppercase hex representations
Diffstat (limited to 'library')
-rw-r--r-- | library/tcltest/tcltest.tcl | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index 285a33d..7dc75d7 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -41,7 +41,9 @@ namespace eval tcltest { outputChannel testConstraint # Export commands that are duplication (candidates for deprecation) - namespace export bytestring ;# dups [encoding convertfrom identity] + if {![package vsatisfies [package provide Tcl] 8.7-]} { + namespace export bytestring ;# dups [encoding convertfrom identity] + } namespace export debug ;# [configure -debug] namespace export errorFile ;# [configure -errfile] namespace export limitConstraints ;# [configure -limitconstraints] @@ -1269,7 +1271,7 @@ proc tcltest::DefineConstraintInitializers {} { ConstraintInitializer nonBlockFiles { set code [expr {[catch {set f [open defs r]}] - || [catch {chan configure $f -blocking off}]}] + || [catch {fconfigure $f -blocking off}]}] catch {close $f} set code } @@ -3079,7 +3081,10 @@ proc tcltest::makeFile {contents name {directory ""}} { putting ``$contents'' into $fullName" set fd [open $fullName w] - chan configure $fd -translation lf + fconfigure $fd -translation lf + if {[package vsatisfies [package provide Tcl] 8.7-]} { + fconfigure $fd -encoding utf-8 + } if {[string index $contents end] eq "\n"} { puts -nonewline $fd $contents } else { @@ -3228,6 +3233,9 @@ 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 + } set data [read -nonewline $f] close $f return $data @@ -3249,6 +3257,9 @@ proc tcltest::viewFile {name {directory ""}} { # construct improperly formed strings in this manner, because it involves # exposing that Tcl uses UTF-8 internally. # +# This function doesn't work any more in Tcl 8.7, since the 'identity' +# is gone (TIP #345) +# # Arguments: # string being converted # @@ -3258,8 +3269,10 @@ proc tcltest::viewFile {name {directory ""}} { # Side effects: # None -proc tcltest::bytestring {string} { - return [encoding convertfrom identity $string] +if {![package vsatisfies [package provide Tcl] 8.7-]} { + proc tcltest::bytestring {string} { + return [encoding convertfrom identity $string] + } } # tcltest::OpenFiles -- |