summaryrefslogtreecommitdiffstats
path: root/tests/cmdAH.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-07-04 11:18:44 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-07-04 11:18:44 (GMT)
commita2c7cc0d23840242eae5fa78dabf9ca1b8dfb28a (patch)
treeea3272552ad92e03b97932cb9990f61f74ede7f2 /tests/cmdAH.test
parent6416a20fd8e2a665f23a1df31e0881b7a91185d4 (diff)
downloadtcl-a2c7cc0d23840242eae5fa78dabf9ca1b8dfb28a.zip
tcl-a2c7cc0d23840242eae5fa78dabf9ca1b8dfb28a.tar.gz
tcl-a2c7cc0d23840242eae5fa78dabf9ca1b8dfb28a.tar.bz2
Use "tcltest::Asciify" in stead of "printable"
Diffstat (limited to 'tests/cmdAH.test')
-rw-r--r--tests/cmdAH.test34
1 files changed, 8 insertions, 26 deletions
diff --git a/tests/cmdAH.test b/tests/cmdAH.test
index f024f36..7cae5c8 100644
--- a/tests/cmdAH.test
+++ b/tests/cmdAH.test
@@ -200,24 +200,6 @@ proc endianUtf {enc} {
return ""
}
-# Map arbitrary strings to printable form in ASCII.
-proc printable {s} {
- set print ""
- foreach c [split $s ""] {
- set i [scan $c %c]
- if {[string is print $c] && ($i <= 127)} {
- append print $c
- } elseif {$i <= 0xff} {
- append print \\x[format %02X $i]
- } elseif {$i <= 0xffff} {
- append print \\u[format %04X $i]
- } else {
- append print \\U[format %08X $i]
- }
- }
- return $print
-}
-
#
# Check errors for invalid number of arguments
proc badnumargs {id cmd cmdargs} {
@@ -347,7 +329,7 @@ unknownencodingtest cmdAH-4.3.9 {convertfrom -failindex VAR -profile ABC}
unknownencodingtest cmdAH-4.3.10 {convertfrom -profile strict -failindex ABC}
testconvert cmdAH-4.3.11 {
encoding convertfrom jis0208 \x38\x43
-} \u4e4e -setup {
+} 乎 -setup {
set system [encoding system]
encoding system iso8859-1
} -cleanup {
@@ -357,7 +339,7 @@ testconvert cmdAH-4.3.11 {
# Verify single arg defaults to system encoding
testconvert cmdAH-4.3.12 {
encoding convertfrom \x38\x43
-} \u4e4e -setup {
+} 乎 -setup {
set system [encoding system]
encoding system jis0208
} -cleanup {
@@ -509,7 +491,7 @@ unknownencodingtest cmdAH-4.4.8 {convertto nosuchencoding ABC}
unknownencodingtest cmdAH-4.4.9 {convertto -failindex VAR -profile ABC}
unknownencodingtest cmdAH-4.4.10 {convertto -profile strict -failindex ABC}
testconvert cmdAH-4.4.11 {
- encoding convertto jis0208 \u4e4e
+ encoding convertto jis0208 乎
} \x38\x43 -setup {
set system [encoding system]
encoding system iso8859-1
@@ -519,7 +501,7 @@ testconvert cmdAH-4.4.11 {
# Verify single arg defaults to system encoding
testconvert cmdAH-4.4.12 {
- encoding convertto \u4e4e
+ encoding convertto 乎
} \x38\x43 -setup {
set system [encoding system]
encoding system jis0208
@@ -532,7 +514,7 @@ testconvert cmdAH-4.4.12 {
foreach {enc str hex ctrl comment} $encValidStrings {
if {"knownBug" in $ctrl} continue
set bytes [binary decode hex $hex]
- set printable [printable $str]
+ set printable [tcltest::Asciify $str]
set prefix A
set suffix B
set prefix_bytes [encoding convertto $enc A]
@@ -549,7 +531,7 @@ foreach {enc str hex ctrl comment} $encValidStrings {
foreach {enc str profile hex failidx ctrl comment} $encUnencodableStrings {
if {"knownBug" in $ctrl} continue
set bytes [binary decode hex $hex]
- set printable [printable $str]
+ set printable [tcltest::Asciify $str]
set prefix A
set suffix B
set prefix_bytes [encoding convertto $enc $prefix]
@@ -598,7 +580,7 @@ foreach {enc str profile hex failidx ctrl comment} $encUnencodableStrings {
foreach {enc str hex ctrl comment} $encValidStrings {
if {"knownBug" in $ctrl} continue
set bytes [binary decode hex $hex]
- set printable [printable $str]
+ set printable [tcltest::Asciify $str]
set prefix A
set suffix B
set prefix_bytes [encoding convertto $enc A]
@@ -615,7 +597,7 @@ foreach {enc str hex ctrl comment} $encValidStrings {
foreach {enc str profile hex failidx ctrl comment} $encUnencodableStrings {
if {"knownBug" in $ctrl} continue
set bytes [binary decode hex $hex]
- set printable [printable $str]
+ set printable [tcltest::Asciify $str]
set prefix A
set suffix B
set prefixLen [string length [encoding convertto $enc $prefix]]