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