os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/llength.test
Update contrib.
1 # Commands covered: llength
3 # This file contains a collection of tests for one or more of the Tcl
4 # built-in commands. Sourcing this file into Tcl runs the tests and
5 # generates output for errors. No output means no errors were found.
7 # Copyright (c) 1991-1993 The Regents of the University of California.
8 # Copyright (c) 1994 Sun Microsystems, Inc.
9 # Copyright (c) 1998-1999 by Scriptics Corporation.
11 # See the file "license.terms" for information on usage and redistribution
12 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
14 # RCS: @(#) $Id: llength.test,v 1.5 2000/04/10 17:19:01 ericm Exp $
16 if {[lsearch [namespace children] ::tcltest] == -1} {
17 package require tcltest
18 namespace import -force ::tcltest::*
21 test llength-1.1 {length of list} {
24 test llength-1.2 {length of list} {
25 llength {a b c {a b {c d}} d}
27 test llength-1.3 {length of list} {
31 test llength-2.1 {error conditions} {
32 list [catch {llength} msg] $msg
33 } {1 {wrong # args: should be "llength list"}}
34 test llength-2.2 {error conditions} {
35 list [catch {llength 123 2} msg] $msg
36 } {1 {wrong # args: should be "llength list"}}
37 test llength-2.3 {error conditions} {
38 list [catch {llength "a b c \{"} msg] $msg
39 } {1 {unmatched open brace in list}}
42 ::tcltest::cleanupTests