summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2006-01-23 11:42:23 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2006-01-23 11:42:23 (GMT)
commit94e3d0ea14f26a1b809ae21a88a2d691185d819a (patch)
tree8157dfea43a7fb32702332d93536f458abb1e3ae /tests
parent5797180be8dc50f5539d7262da04e069b8c4a726 (diff)
downloadtcl-94e3d0ea14f26a1b809ae21a88a2d691185d819a.zip
tcl-94e3d0ea14f26a1b809ae21a88a2d691185d819a.tar.gz
tcl-94e3d0ea14f26a1b809ae21a88a2d691185d819a.tar.bz2
Added test for [Bug 1410553]
Diffstat (limited to 'tests')
-rw-r--r--tests/string.test18
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