os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/llength.test
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/llength.test Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,55 @@
1.4 +# Commands covered: llength
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: llength.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 llength-1.1 {length of list} {
1.25 + llength {a b c d}
1.26 +} 4
1.27 +test llength-1.2 {length of list} {
1.28 + llength {a b c {a b {c d}} d}
1.29 +} 5
1.30 +test llength-1.3 {length of list} {
1.31 + llength {}
1.32 +} 0
1.33 +
1.34 +test llength-2.1 {error conditions} {
1.35 + list [catch {llength} msg] $msg
1.36 +} {1 {wrong # args: should be "llength list"}}
1.37 +test llength-2.2 {error conditions} {
1.38 + list [catch {llength 123 2} msg] $msg
1.39 +} {1 {wrong # args: should be "llength list"}}
1.40 +test llength-2.3 {error conditions} {
1.41 + list [catch {llength "a b c \{"} msg] $msg
1.42 +} {1 {unmatched open brace in list}}
1.43 +
1.44 +# cleanup
1.45 +::tcltest::cleanupTests
1.46 +return
1.47 +
1.48 +
1.49 +
1.50 +
1.51 +
1.52 +
1.53 +
1.54 +
1.55 +
1.56 +
1.57 +
1.58 +