diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2006-01-23 11:42:23 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2006-01-23 11:42:23 (GMT) |
commit | 94e3d0ea14f26a1b809ae21a88a2d691185d819a (patch) | |
tree | 8157dfea43a7fb32702332d93536f458abb1e3ae /tests/string.test | |
parent | 5797180be8dc50f5539d7262da04e069b8c4a726 (diff) | |
download | tcl-94e3d0ea14f26a1b809ae21a88a2d691185d819a.zip tcl-94e3d0ea14f26a1b809ae21a88a2d691185d819a.tar.gz tcl-94e3d0ea14f26a1b809ae21a88a2d691185d819a.tar.bz2 |
Added test for [Bug 1410553]
Diffstat (limited to 'tests/string.test')
-rw-r--r-- | tests/string.test | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/string.test b/tests/string.test index a461a5e..c23a200 100644 --- a/tests/string.test +++ b/tests/string.test @@ -12,7 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: string.test,v 1.55 2005/12/19 19:03:17 dgp Exp $ +# RCS: @(#) $Id: string.test,v 1.56 2006/01/23 11:42:23 dkf Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -1109,6 +1109,22 @@ test string-12.19 {string range, bytearray object} { test string-12.20 {string range, out of bounds indices} { string range \u00ff 0 1 } \u00ff +# Bug 1410553 +test string-12.21 {string range, regenerates correct reps} { + set bytes "\x00 \x03 \x41" + set rxBuffer {} + foreach ch $bytes { + append rxBuffer $ch + if {$ch eq "\x03"} { + string length $rxBuffer + } + } + set rxCRC [string range $rxBuffer end-1 end] + binary scan [join $bytes {}] "H*" input_hex + binary scan $rxBuffer "H*" rxBuffer_hex + binary scan $rxCRC "H*" rxCRC_hex + list $input_hex $rxBuffer_hex $rxCRC_hex +} {000341 000341 0341} test string-13.1 {string repeat} { list [catch {string repeat} msg] $msg |