diff options
Diffstat (limited to 'tests')
-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 |