summaryrefslogtreecommitdiffstats
path: root/tests/binary.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2013-09-01 20:08:50 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2013-09-01 20:08:50 (GMT)
commit0576e11ae0dee27fb806110d84024c8aff28f941 (patch)
tree0b39c71d35007a231dd0f7dabb817657474cb439 /tests/binary.test
parent1d512f82013b5c80636c8522357aabe3b429f143 (diff)
downloadtcl-0576e11ae0dee27fb806110d84024c8aff28f941.zip
tcl-0576e11ae0dee27fb806110d84024c8aff28f941.tar.gz
tcl-0576e11ae0dee27fb806110d84024c8aff28f941.tar.bz2
[b98fa55285]: Fix handling of whitespace at end of hex strings to decode.
Diffstat (limited to 'tests/binary.test')
-rw-r--r--tests/binary.test28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/binary.test b/tests/binary.test
index 4393245..d424837 100644
--- a/tests/binary.test
+++ b/tests/binary.test
@@ -2499,6 +2499,34 @@ test binary-71.9 {binary decode hex} -body {
test binary-71.10 {binary decode hex} -body {
string length [binary decode hex " "]
} -result 0
+test binary-71.11 {binary decode hex: Bug b98fa55285} -body {
+ apply {{} {
+ set str "137b6f95e7519389e7c4b36599781e2ccf492699649249aae43fbe8c26\n"
+ set decoded [binary decode hex $str]
+ list [string length $decoded] [scan [string index $decoded end] %c]
+ }}
+} -result {29 38}
+test binary-71.12 {binary decode hex: Bug b98fa55285 cross check} -body {
+ apply {{} {
+ set str "137b6f95e7519389e7c4b36599781e2ccf492699649249aae43fbe8c2\n"
+ set decoded [binary decode hex $str]
+ list [string length $decoded] [scan [string index $decoded end] %c]
+ }}
+} -result {28 140}
+test binary-71.13 {binary decode hex: Bug b98fa55285 cross check} -body {
+ apply {{} {
+ set str "137b6f95e7519389e7c4b36599781e2ccf492699649249aae43fbe8c2\n\n"
+ set decoded [binary decode hex $str]
+ list [string length $decoded] [scan [string index $decoded end] %c]
+ }}
+} -result {28 140}
+test binary-71.14 {binary decode hex: Bug b98fa55285 cross check} -body {
+ apply {{} {
+ set str "137b6f95e7519389e7c4b36599781e2ccf492699649249aae43fbe8c2\n\n\n"
+ set decoded [binary decode hex $str]
+ list [string length $decoded] [scan [string index $decoded end] %c]
+ }}
+} -result {28 140}
test binary-72.1 {binary encode base64} -body {
binary encode base64