diff options
author | dgp <dgp@users.sourceforge.net> | 2017-11-03 16:48:44 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2017-11-03 16:48:44 (GMT) |
commit | 10a93057770dc08da0e135cea50d1a723fa47f42 (patch) | |
tree | 8462554737d8c711cda8650198489a455720a56c /tests/encoding.test | |
parent | d8596e5583d20147b85d5ccfba213628abb2b5e8 (diff) | |
parent | 2ff3ecb5341d0f53ebff051ad63dd6a8dd619234 (diff) | |
download | tcl-10a93057770dc08da0e135cea50d1a723fa47f42.zip tcl-10a93057770dc08da0e135cea50d1a723fa47f42.tar.gz tcl-10a93057770dc08da0e135cea50d1a723fa47f42.tar.bz2 |
TIP 345 Implementation.
Diffstat (limited to 'tests/encoding.test')
-rw-r--r-- | tests/encoding.test | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/tests/encoding.test b/tests/encoding.test index ffac748..e447c20 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -34,6 +34,8 @@ proc runtests {} { # Some tests require the testencoding command testConstraint testencoding [llength [info commands testencoding]] +testConstraint testbytestring [llength [info commands testbytestring]] +testConstraint teststringbytes [llength [info commands teststringbytes]] testConstraint fullutf [expr {[format %c 0x010000] != "\ufffd"}] testConstraint exec [llength [info commands exec]] testConstraint testgetencpath [llength [info commands testgetencpath]] @@ -308,26 +310,18 @@ test encoding-13.1 {LoadEscapeTable} { viewable [set x [encoding convertto iso2022 ab\u4e4e\u68d9g]] } [viewable "ab\x1b\$B8C\x1b\$\(DD%\x1b(Bg"] -test encoding-14.1 {BinaryProc} { - encoding convertto identity \x12\x34\x56\xff\x69 -} "\x12\x34\x56\xc3\xbf\x69" - test encoding-15.1 {UtfToUtfProc} { encoding convertto utf-8 \xa3 } "\xc2\xa3" -test encoding-15.2 {UtfToUtfProc null character output} { - set x \u0000 - set y [encoding convertto utf-8 \u0000] - set y [encoding convertfrom identity $y] - binary scan $y H* z - list [string bytelength $x] [string bytelength $y] $z -} {2 1 00} -test encoding-15.3 {UtfToUtfProc null character input} { - set x [encoding convertfrom identity \x00] - set y [encoding convertfrom utf-8 $x] - binary scan [encoding convertto identity $y] H* z - list [string bytelength $x] [string bytelength $y] $z -} {1 2 c080} +test encoding-15.2 {UtfToUtfProc null character output} testbytestring { + binary scan [testbytestring [encoding convertto utf-8 \u0000]] H* z + set z +} 00 +test encoding-15.3 {UtfToUtfProc null character input} teststringbytes { + set y [encoding convertfrom utf-8 [encoding convertto utf-8 \u0000]] + binary scan [teststringbytes $y] H* z + set z +} c080 test encoding-16.1 {UnicodeToUtfProc} { set val [encoding convertfrom unicode NN] |