summaryrefslogtreecommitdiffstats
path: root/tests/list.test
diff options
context:
space:
mode:
authormdejong <mdejong>2010-02-12 03:21:32 (GMT)
committermdejong <mdejong>2010-02-12 03:21:32 (GMT)
commitbbe0b1645349bb22662c4a8858a4fce1e5e07132 (patch)
tree2b588e2697c4889438249793e1ca4dd53d6b1cf8 /tests/list.test
parent9f5bce3cf43a2bddf371367d361c3fd289131e4a (diff)
downloadtcl-bbe0b1645349bb22662c4a8858a4fce1e5e07132.zip
tcl-bbe0b1645349bb22662c4a8858a4fce1e5e07132.tar.gz
tcl-bbe0b1645349bb22662c4a8858a4fce1e5e07132.tar.bz2
add tests for explicit backslash zero as argument to list command
Diffstat (limited to 'tests/list.test')
-rw-r--r--tests/list.test22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/list.test b/tests/list.test
index 01dc060..0dd2d73 100644
--- a/tests/list.test
+++ b/tests/list.test
@@ -11,7 +11,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: list.test,v 1.7 2003/07/24 16:05:24 dgp Exp $
+# RCS: @(#) $Id: list.test,v 1.8 2010/02/12 03:21:32 mdejong Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -46,6 +46,26 @@ test list-1.23 {basic tests} {list \{} "\\{"
test list-1.24 {basic tests} {list} {}
test list-1.25 {basic tests} {list # #} {{#} #}
test list-1.26 {basic tests} {list #\{ #\{} {\#\{ #\{}
+test list-1.27 {basic null treatment} {
+ set l [list "" "\0" "\0\0"]
+ set e "{} \0 \0\0"
+ string equal $l $e
+} 1
+test list-1.28 {basic null treatment} {
+ set result "\0a\0b"
+ list $result [string length $result]
+} "\0a\0b 4"
+test list-1.29 {basic null treatment} {
+ set result "\0a\0b"
+ set srep "$result 4"
+ set lrep [list $result [string length $result]]
+ string equal $srep $lrep
+} 1
+test list-1.30 {basic null treatment} {
+ set l [list "\0abc" "xyz"]
+ set e "\0abc xyz"
+ string equal $l $e
+} 1
# For the next round of tests create a list and then pick it apart
# with "index" to make sure that we get back exactly what went in.