os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/join.test
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/join.test	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,66 @@
     1.4 +# Commands covered:  join
     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 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: join.test,v 1.5 2000/04/10 17:19:01 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 join-1.1 {basic join commands} {
    1.25 +    join {a b c} xyz
    1.26 +} axyzbxyzc
    1.27 +test join-1.2 {basic join commands} {
    1.28 +    join {a b c} {}
    1.29 +} abc
    1.30 +test join-1.3 {basic join commands} {
    1.31 +    join {} xyz
    1.32 +} {}
    1.33 +test join-1.4 {basic join commands} {
    1.34 +    join {12 34 56}
    1.35 +} {12 34 56}
    1.36 +
    1.37 +test join-2.1 {join errors} {
    1.38 +    list [catch join msg] $msg $errorCode
    1.39 +} {1 {wrong # args: should be "join list ?joinString?"} NONE}
    1.40 +test join-2.2 {join errors} {
    1.41 +    list [catch {join a b c} msg] $msg $errorCode
    1.42 +} {1 {wrong # args: should be "join list ?joinString?"} NONE}
    1.43 +test join-2.3 {join errors} {
    1.44 +    list [catch {join "a \{ c" 111} msg] $msg $errorCode
    1.45 +} {1 {unmatched open brace in list} NONE}
    1.46 +
    1.47 +test join-3.1 {joinString is binary ok} {
    1.48 +  string length [join {a b c} a\0b]
    1.49 +} 9
    1.50 +
    1.51 +test join-3.2 {join is binary ok} {
    1.52 +  string length [join "a\0b a\0b a\0b"]
    1.53 +} 11
    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 +