diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/list.test | 22 |
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. |