diff options
author | dkf <dkf@noemail.net> | 2003-07-11 21:14:44 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2003-07-11 21:14:44 (GMT) |
commit | 13fbb63c69d210e3725bb456671bc59b1e17e5ac (patch) | |
tree | ac12d6dea1adb38e45ba88b1e51f8238e83b9b21 /tests/binary.test | |
parent | b892c8d99f00e2adf9840b889a15476450f2b9e9 (diff) | |
download | tcl-13fbb63c69d210e3725bb456671bc59b1e17e5ac.zip tcl-13fbb63c69d210e3725bb456671bc59b1e17e5ac.tar.gz tcl-13fbb63c69d210e3725bb456671bc59b1e17e5ac.tar.bz2 |
Documented and tested for the current behaviour of [binary format a] and
[binary scan ? a]. This is what they've been doing all along. [Bug 735364]
FossilOrigin-Name: d4013a53351152f2116386ac21d00372ffda7797
Diffstat (limited to 'tests/binary.test')
-rw-r--r-- | tests/binary.test | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/binary.test b/tests/binary.test index 967fcbc..c7860e9 100644 --- a/tests/binary.test +++ b/tests/binary.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: binary.test,v 1.11 2003/02/21 21:54:11 dkf Exp $ +# RCS: @(#) $Id: binary.test,v 1.12 2003/07/11 21:14:46 dkf Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -1494,6 +1494,28 @@ test binary-45.2 {Tcl_BinaryObjCmd: combined wide int handling} { set x } {66 64 0 0 0 0 127 -1 -1 -1 65 76} +test binary-46.1 {Tcl_BinaryObjCmd: handling of non-ISO8859-1 chars} { + binary format a* \u20ac +} \u00ac +test binary-46.2 {Tcl_BinaryObjCmd: handling of non-ISO8859-1 chars} { + list [binary scan [binary format a* \u20ac\u20bd] s x] $x +} {1 -16980} +test binary-46.3 {Tcl_BinaryObjCmd: handling of non-ISO8859-1 chars} { + set x {} + set y {} + set z {} + list [binary scan [binary format a* \u20ac\u20bd] aaa x y z] $x $y $z +} "2 \u00ac \u00bd {}" +test binary-46.4 {Tcl_BinaryObjCmd: handling of non-ISO8859-1 chars} { + set x [encoding convertto iso8859-15 \u20ac] + set y [binary format a* $x] + list $x $y +} "\u00a4 \u00a4" +test binary-46.5 {Tcl_BinaryObjCmd: handling of non-ISO8859-1 chars} { + set x [binary scan \u00a4 a* y] + list $x $y [encoding convertfrom iso8859-15 $y] +} "1 \u00a4 \u20ac" + # cleanup ::tcltest::cleanupTests return |