1 # These regression tests all provoked crashes at some point.
2 # Thus they are kept separate from the regular test suite in tests/
5 # 27Jan2005 - SIGSEGV for bug on Jim_DuplicateObj().
7 for {set i
0} {$i < 100} {incr i
} {
14 # 29Jan2005 - SEGFAULT parsing script composed of just one comment.
19 # 29Jan2005 - "Error in Expression" with correct expression
25 # 29Jan2005 - SIGSEGV when run this code, due to expr's bug.
30 expr {[fibonacci
[expr {$x-1}]] + [fibonacci
[expr {$x-2}]]}
37 # 06Mar2005 - This looped forever...
38 for {set i
0} {$i < 10} {incr i
} {continue}
42 # 07Mar2005 - Unset create variable + dict is using dict syntax sugar at
43 # currently non-existing variable
44 catch {unset thisvardoesnotexists
(thiskeytoo
)}
45 if {[catch {set thisvardoesnotexists
}] == 0} {
46 puts "TEST 6 FAILED - unset created dict for non-existing variable"
52 # 04Nov2008 - variable parsing does not eat last brace
58 # 04Nov2008 - string toupper/tolower do not convert to string rep
59 string tolower
[list a
]
60 string toupper
[list a
]
64 # 04Nov2008 - crash on exit when replacing Tcl proc with C command.
65 # Requires the clock extension to be built as a loadable module.
67 catch {package require
clock}
68 # Note, crash on exit, so don't say we passed!
71 # 05Nov2008 - incorrect lazy expression evaluation with unary not
76 # 14 Feb 2010 - access static variable in deleted proc
77 proc a
{} {{x
1}} { rename a
""; incr x
}
82 # 13 Sep 2010 - reference with invalid tag
83 set a b
[ref value
"tag name"]
84 getref
[string range
$a 1 end
]
88 # 14 Sep 2010 - parse list with trailing backslash
89 set x
"switch -0 \$on \\"
94 # 14 Sep 2010 - command expands to nothing
99 # 24 Feb 2010 - bad reference counting of the stack trace in 'error'
101 tailcall
error $msg $stack
103 catch {fail
} msg opts
104 catch {a
$msg $opts(-errorinfo)}
107 # 24 Feb 2010 - rename the current proc
108 # Leaves unfreed objects on the stack
109 proc a
{} { rename a newa
}
113 # 26 Nov 2010 - crashes on invalid dict sugar
115 puts "TEST 17 PASSED"
118 # 12 Apr 2011 - crashes on unset for loop var
120 for {set i
0} {$i < 5} {incr i
} {unset i
}
122 puts "TEST 18 PASSED"
125 # 25 May 2011 - crashes with double colon
129 puts "TEST 19 PASSED"
132 # 26 May 2011 - infinite recursion
133 proc a
{} { global ::blah; set ::blah test
}
135 puts "TEST 20 PASSED"
138 # 26 May 2011 - infinite loop with null byte in subst
140 puts "TEST 21 PASSED"
143 # 21 June 2011 - crashes on lappend to to value with script rep
147 puts "TEST 22 PASSED"
150 # 27 July 2011 - unfreed objects on exit
156 # Actually, the test passes if no objects leaked on exit
157 puts "TEST 23 PASSED"
160 # 13 Nov 2011 - invalid cached global var
169 puts "TEST 24 PASSED"
172 # 14 Nov 2011 - link global var to proc var
182 puts "TEST 25 PASSED"
185 # 2 Dec 2011 - infinite eval recursion
188 set y
{incr x
; eval $y}
191 puts "TEST 26 PASSED"
194 # 2 Dec 2011 - infinite alias recursion
200 puts "TEST 27 PASSED"
203 # 16 Dec 2011 - ref count problem with finalizers
208 puts "TEST 28 PASSED"
211 # Reference counting problem at exit
215 puts "TEST 29 PASSED"
218 # non-UTF8 string tolower
219 string tolower
"/mod/video/h\303\203\302\244xan_ witchcraft through the ages_20131101_0110.t"
220 puts "TEST 30 PASSED"
223 # infinite lsort -unique with error
224 catch {lsort -unique -real {foo
42.0}}
225 puts "TEST 31 PASSED"
228 # return -code eval should only used by tailcall, but this incorrect usage
229 # should not crash the interpreter
230 proc a
{} { tailcall b
}
231 proc b
{} { return -code eval c
}
234 puts "TEST 32 PASSED"
237 # unset array variable which doesn't exist
238 array unset blahblah abc
239 puts "TEST 33 PASSED"
242 # onexception and writable conflict
243 set f
[open [info nameofexecutable
]]
244 $f onexception
{incr x
}
247 puts "TEST 34 PASSED"
249 # TAKE THE FOLLOWING puts AS LAST LINE
251 puts "--- ALL TESTS PASSED ---"