os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/concat.test
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/concat.test Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,66 @@
1.4 +# Commands covered: concat
1.5 +#
1.6 +# This file contains a collection of tests for one or more of the Tcl
1.7 +# built-in commands. Sourcing this file into Tcl runs the tests and
1.8 +# generates output for errors. No output means no errors were found.
1.9 +#
1.10 +# Copyright (c) 1991-1993 The Regents of the University of California.
1.11 +# Copyright (c) 1994-1996 Sun Microsystems, Inc.
1.12 +# Copyright (c) 1998-1999 by Scriptics Corporation.
1.13 +#
1.14 +# See the file "license.terms" for information on usage and redistribution
1.15 +# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
1.16 +#
1.17 +# RCS: @(#) $Id: concat.test,v 1.5 2000/04/10 17:18:58 ericm Exp $
1.18 +
1.19 +if {[lsearch [namespace children] ::tcltest] == -1} {
1.20 + package require tcltest
1.21 + namespace import -force ::tcltest::*
1.22 +}
1.23 +
1.24 +test concat-1.1 {simple concatenation} {
1.25 + concat a b c d e f g
1.26 +} {a b c d e f g}
1.27 +test concat-1.2 {merging lists together} {
1.28 + concat a {b c d} {e f g h}
1.29 +} {a b c d e f g h}
1.30 +test concat-1.3 {merge lists, retain sub-lists} {
1.31 + concat a {b {c d}} {{e f}} g h
1.32 +} {a b {c d} {e f} g h}
1.33 +test concat-1.4 {special characters} {
1.34 + concat a\{ {b \{c d} \{d
1.35 +} "a{ b \\{c d {d"
1.36 +
1.37 +test concat-2.1 {error: one empty argument} {
1.38 + concat {}
1.39 +} {}
1.40 +
1.41 +test concat-3.1 {error: no arguments} {
1.42 + list [catch concat msg] $msg
1.43 +} {0 {}}
1.44 +
1.45 +test concat-4.1 {pruning off extra white space} {
1.46 + concat {} {a b c}
1.47 +} {a b c}
1.48 +test concat-4.2 {pruning off extra white space} {
1.49 + concat x y " a b c \n\t " " " " def "
1.50 +} {x y a b c def}
1.51 +test concat-4.3 {pruning off extra white space sets length correctly} {
1.52 + llength [concat { {{a}} }]
1.53 +} 1
1.54 +
1.55 +# cleanup
1.56 +::tcltest::cleanupTests
1.57 +return
1.58 +
1.59 +
1.60 +
1.61 +
1.62 +
1.63 +
1.64 +
1.65 +
1.66 +
1.67 +
1.68 +
1.69 +