sl@0: # Commands covered:  various
sl@0: #
sl@0: # This file contains a collection of miscellaneous Tcl tests that
sl@0: # don't fit naturally in any of the other test files.  Many of these
sl@0: # tests are pathological cases that caused bugs in earlier Tcl
sl@0: # releases.
sl@0: #
sl@0: # Copyright (c) 1992-1993 The Regents of the University of California.
sl@0: # Copyright (c) 1994-1996 Sun Microsystems, Inc.
sl@0: # Copyright (c) 1998-1999 by Scriptics Corporation.
sl@0: #
sl@0: # See the file "license.terms" for information on usage and redistribution
sl@0: # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
sl@0: #
sl@0: # RCS: @(#) $Id: misc.test,v 1.6 2003/02/16 01:36:32 msofer Exp $
sl@0: 
sl@0: if {[lsearch [namespace children] ::tcltest] == -1} {
sl@0:     package require tcltest
sl@0:     namespace import -force ::tcltest::*
sl@0: }
sl@0: 
sl@0: test misc-1.1 {error in variable ref. in command in array reference} {
sl@0:     proc tstProc {} {
sl@0: 	global a
sl@0:     
sl@0: 	set tst $a([winfo name $zz])
sl@0: 	# this is a bogus comment
sl@0: 	# this is a bogus comment
sl@0: 	# this is a bogus comment
sl@0: 	# this is a bogus comment
sl@0: 	# this is a bogus comment
sl@0: 	# this is a bogus comment
sl@0: 	# this is a bogus comment
sl@0: 	# this is a bogus comment
sl@0:     }
sl@0:     set msg {}
sl@0:     list [catch tstProc msg] $msg
sl@0: } {1 {can't read "zz": no such variable}}
sl@0: test misc-1.2 {error in variable ref. in command in array reference} {
sl@0:     proc tstProc {} "
sl@0: 	global a
sl@0:     
sl@0: 	set tst \$a(\[winfo name \$\{zz)
sl@0: 	# this is a bogus comment
sl@0: 	# this is a bogus comment
sl@0: 	# this is a bogus comment
sl@0: 	# this is a bogus comment
sl@0: 	# this is a bogus comment
sl@0: 	# this is a bogus comment
sl@0: 	# this is a bogus comment
sl@0: 	# this is a bogus comment
sl@0:     "
sl@0:     set msg {}
sl@0:     join [list [catch tstProc msg] $msg $errorInfo] \n
sl@0: } [subst -novariables -nocommands {1
sl@0: missing close-brace for variable name
sl@0: missing close-brace for variable name
sl@0:     while compiling
sl@0: "set tst $a([winfo name $\{zz)
sl@0: 	# this is a bogus comment
sl@0: 	# this is a bogus comment
sl@0: 	# this is a bogus comment
sl@0: 	# this is a bogus comment
sl@0: 	# this is a ..."
sl@0:     (compiling body of proc "tstProc", line 4)
sl@0:     invoked from within
sl@0: "tstProc"}]
sl@0: 
sl@0: # cleanup
sl@0: ::tcltest::cleanupTests
sl@0: return
sl@0: 
sl@0: 
sl@0: 
sl@0: 
sl@0: 
sl@0: 
sl@0: 
sl@0: 
sl@0: 
sl@0: 
sl@0: 
sl@0: