os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/misc.test
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 # Commands covered:  various
     2 #
     3 # This file contains a collection of miscellaneous Tcl tests that
     4 # don't fit naturally in any of the other test files.  Many of these
     5 # tests are pathological cases that caused bugs in earlier Tcl
     6 # releases.
     7 #
     8 # Copyright (c) 1992-1993 The Regents of the University of California.
     9 # Copyright (c) 1994-1996 Sun Microsystems, Inc.
    10 # Copyright (c) 1998-1999 by Scriptics Corporation.
    11 #
    12 # See the file "license.terms" for information on usage and redistribution
    13 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    14 #
    15 # RCS: @(#) $Id: misc.test,v 1.6 2003/02/16 01:36:32 msofer Exp $
    16 
    17 if {[lsearch [namespace children] ::tcltest] == -1} {
    18     package require tcltest
    19     namespace import -force ::tcltest::*
    20 }
    21 
    22 test misc-1.1 {error in variable ref. in command in array reference} {
    23     proc tstProc {} {
    24 	global a
    25     
    26 	set tst $a([winfo name $zz])
    27 	# this is a bogus comment
    28 	# this is a bogus comment
    29 	# this is a bogus comment
    30 	# this is a bogus comment
    31 	# this is a bogus comment
    32 	# this is a bogus comment
    33 	# this is a bogus comment
    34 	# this is a bogus comment
    35     }
    36     set msg {}
    37     list [catch tstProc msg] $msg
    38 } {1 {can't read "zz": no such variable}}
    39 test misc-1.2 {error in variable ref. in command in array reference} {
    40     proc tstProc {} "
    41 	global a
    42     
    43 	set tst \$a(\[winfo name \$\{zz)
    44 	# this is a bogus comment
    45 	# this is a bogus comment
    46 	# this is a bogus comment
    47 	# this is a bogus comment
    48 	# this is a bogus comment
    49 	# this is a bogus comment
    50 	# this is a bogus comment
    51 	# this is a bogus comment
    52     "
    53     set msg {}
    54     join [list [catch tstProc msg] $msg $errorInfo] \n
    55 } [subst -novariables -nocommands {1
    56 missing close-brace for variable name
    57 missing close-brace for variable name
    58     while compiling
    59 "set tst $a([winfo name $\{zz)
    60 	# this is a bogus comment
    61 	# this is a bogus comment
    62 	# this is a bogus comment
    63 	# this is a bogus comment
    64 	# this is a ..."
    65     (compiling body of proc "tstProc", line 4)
    66     invoked from within
    67 "tstProc"}]
    68 
    69 # cleanup
    70 ::tcltest::cleanupTests
    71 return
    72 
    73 
    74 
    75 
    76 
    77 
    78 
    79 
    80 
    81 
    82 
    83