summaryrefslogtreecommitdiffstats
path: root/tests/misc.test
blob: d4ece741c118da9b57695328df1818fcd01290de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Commands covered:  various
#
# This file contains a collection of miscellaneous Tcl tests that
# don't fit naturally in any of the other test files.  Many of these
# tests are pathological cases that caused bugs in earlier Tcl
# releases.
#
# Copyright (c) 1992-1993 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.

if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest
    namespace import -force ::tcltest::*
}

::tcltest::loadTestedCommands
catch [list package require -exact Tcltest [info patchlevel]]

testConstraint testhashsystemhash [llength [info commands testhashsystemhash]]

test misc-1.1 {error in variable ref. in command in array reference} {
    proc tstProc {} {
	global a
    
	set tst $a([winfo name $zz])
	# this is a bogus comment
	# this is a bogus comment
	# this is a bogus comment
	# this is a bogus comment
	# this is a bogus comment
	# this is a bogus comment
	# this is a bogus comment
	# this is a bogus comment
    }
    set msg {}
    list [catch tstProc msg] $msg
} {1 {can't read "zz": no such variable}}
test misc-1.2 {error in variable ref. in command in array reference} {
    proc tstProc {} "
	global a
    
	set tst \$a(\[winfo name \$\{zz)
	# this is a bogus comment
	# this is a bogus comment
	# this is a bogus comment
	# this is a bogus comment
	# this is a bogus comment
	# this is a bogus comment
	# this is a bogus comment
	# this is a bogus comment
    "
    set msg {}
    join [list [catch tstProc msg] $msg $::errorInfo] \n
} [subst -novariables -nocommands {1
missing close-brace for variable name
missing close-brace for variable name
    while executing
"set tst $a([winfo name $\{"
    (procedure "tstProc" line 4)
    invoked from within
"tstProc"}]

for {set i 1} {$i<300} {incr i} {
    test misc-2.$i {hash table with sys-alloc} testhashsystemhash \
	    "testhashsystemhash $i" OK
}

# cleanup
::tcltest::cleanupTests
return
logstatsplain -rw-r--r--htmllib.py12869logstatsplain -rw-r--r--httplib.py51163logstatsplain d---------idlelib3158logstatsplain -rw-r--r--ihooks.py18986logstatsplain -rw-r--r--imaplib.py48419logstatsplain -rw-r--r--imghdr.py3541logstatsplain d---------importlib39logstatsplain -rw-r--r--imputil.py25764logstatsplain -rw-r--r--inspect.py42611logstatsplain -rw-r--r--io.py3321logstatsplain d---------json220logstatsplain -rwxr-xr-xkeyword.py1996logstatsplain d---------lib-tk747logstatsplain d---------lib2to3609logstatsplain -rw-r--r--linecache.py4027logstatsplain -rw-r--r--locale.py99516logstatsplain d---------logging115logstatsplain -rw-r--r--macpath.py6289logstatsplain -rw-r--r--macurl2path.py2731logstatsplain -rw-r--r--mailbox.py81240logstatsplain -rw-r--r--mailcap.py7429logstatsplain -rw-r--r--markupbase.py14643logstatsplain -rw-r--r--md5.py358logstatsplain -rw-r--r--mhlib.py33434logstatsplain -rw-r--r--mimetools.py7168logstatsplain -rw-r--r--mimetypes.py20942logstatsplain -rwxr-xr-xmimify.py15021logstatsplain -rw-r--r--modulefinder.py24461logstatsplain d---------msilib150logstatsplain -rw-r--r--multifile.py4820logstatsplain d---------multiprocessing494logstatsplain -rw-r--r--mutex.py1878logstatsplain -rw-r--r--netrc.py5865logstatsplain -rw-r--r--new.py610logstatsplain -rw-r--r--nntplib.py21470logstatsplain -rw-r--r--ntpath.py19429logstatsplain -rw-r--r--nturl2path.py2419logstatsplain -rw-r--r--numbers.py10319logstatsplain -rw-r--r--opcode.py5474logstatsplain -rw-r--r--optparse.py61203logstatsplain -rw-r--r--os.py25910logstatsplain -rw-r--r--os2emxpath.py4635logstatsplain -rw-r--r--pdb.doc7914logstatsplain -rwxr-xr-xpdb.py46099logstatsplain -rw-r--r--pickle.py45489logstatsplain -rw-r--r--pickletools.py74541logstatsplain -rw-r--r--pipes.py9582logstatsplain -rw-r--r--pkgutil.py20346logstatsplain d---------plat-aix366logstatsplain d---------plat-aix466logstatsplain d---------plat-atheos102logstatsplain d---------plat-beos566logstatsplain d---------plat-darwin66logstatsplain d---------plat-freebsd466logstatsplain d---------plat-freebsd566logstatsplain d---------plat-freebsd666logstatsplain d---------plat-freebsd766logstatsplain d---------plat-freebsd866logstatsplain d---------plat-generic33logstatsplain d---------plat-irix5916logstatsplain d---------plat-irix6879logstatsplain d---------plat-linux2174logstatsplain d---------plat-mac1220logstatsplain d---------plat-netbsd166logstatsplain d---------plat-next333logstatsplain d---------plat-os2emx211logstatsplain d---------plat-riscos126logstatsplain d---------plat-sunos5253logstatsplain d---------plat-unixware7104logstatsplain -rwxr-xr-xplatform.py51537logstatsplain -rw-r--r--plistlib.py15185logstatsplain -rw-r--r--popen2.py8416logstatsplain -rw-r--r--poplib.py12822logstatsplain -rw-r--r--posixfile.py8003logstatsplain -rw-r--r--posixpath.py13925logstatsplain -rw-r--r--pprint.py11777logstatsplain -rwxr-xr-xprofile.py22782logstatsplain -rw-r--r--pstats.py26712logstatsplain -rw-r--r--pty.py5058logstatsplain -rw-r--r--py_compile.py5936logstatsplain -rw-r--r--pyclbr.py13388logstatsplain -rwxr-xr-xpydoc.py95514logstatsplain d---------pydoc_data76logstatsplain -rwxr-xr-xquopri.py6969logstatsplain -rw-r--r--random.py32323logstatsplain -rw-r--r--re.py13423logstatsplain -rw-r--r--repr.py4296logstatsplain -rw-r--r--rexec.py20148logstatsplain -rw-r--r--rfc822.py33542logstatsplain -rw-r--r--rlcompleter.py5991logstatsplain -rw-r--r--robotparser.py7587logstatsplain -rw-r--r--runpy.py11081logstatsplain -rw-r--r--sched.py5088logstatsplain -rw-r--r--sets.py19050logstatsplain -rw-r--r--sgmllib.py17884logstatsplain -rw-r--r--sha.py393logstatsplain -rw-r--r--shelve.py8178logstatsplain -rw-r--r--shlex.py11137logstatsplain -rw-r--r--shutil.py18972logstatsplain d---------site-packages34logstatsplain -rw-r--r--site.py19591logstatsplain -rwxr-xr-xsmtpd.py18543logstatsplain -rwxr-xr-xsmtplib.py32106logstatsplain -rw-r--r--sndhdr.py5973logstatsplain -rw-r--r--socket.py20615logstatsplain d---------sqlite3142logstatsplain -rw-r--r--sre.py384logstatsplain -rw-r--r--sre_compile.py19817logstatsplain -rw-r--r--sre_constants.py7197logstatsplain -rw-r--r--sre_parse.py28911logstatsplain -rw-r--r--ssl.py37434logstatsplain -rw-r--r--stat.py1842logstatsplain -rw-r--r--statvfs.py898logstatsplain