diff options
author | dgp <dgp@users.sourceforge.net> | 2013-08-14 18:00:45 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2013-08-14 18:00:45 (GMT) |
commit | a733cde27c904a40aae56e93c7daa369e2a4d045 (patch) | |
tree | 77fdf9d45381002ae272a660dd3090c4d9459dc5 /tests/parse.test | |
parent | 133a3b34b7419b202d6588f44871ea67176a5064 (diff) | |
parent | 2b3657769b1d0b9ae6e10113b1d3c038b4967899 (diff) | |
download | tcl-a733cde27c904a40aae56e93c7daa369e2a4d045.zip tcl-a733cde27c904a40aae56e93c7daa369e2a4d045.tar.gz tcl-a733cde27c904a40aae56e93c7daa369e2a4d045.tar.bz2 |
merge trunk
Diffstat (limited to 'tests/parse.test')
-rw-r--r-- | tests/parse.test | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/parse.test b/tests/parse.test index b9cfe80..01443c9 100644 --- a/tests/parse.test +++ b/tests/parse.test @@ -27,6 +27,7 @@ testConstraint testparsevar [llength [info commands testparsevar]] testConstraint testasync [llength [info commands testasync]] testConstraint testcmdtrace [llength [info commands testcmdtrace]] testConstraint testevent [llength [info commands testevent]] +testConstraint memory [llength [info commands memory]] test parse-1.1 {Tcl_ParseCommand procedure, computing string length} testparser { testparser [bytestring "foo\0 bar"] -1 @@ -678,6 +679,26 @@ test parse-13.5 {Tcl_ParseVar procedure, error looking up variable} testparsevar unset -nocomplain abc list [catch {testparsevar {$abc([bogus x y z])}} msg] $msg } {1 {invalid command name "bogus"}} +test parse-13.6 {Tcl_ParseVar memory leak} -constraints memory -setup { + proc getbytes {} { + return [lindex [split [memory info] \n] 3 3] + } +} -body { + set a() foo + set end [getbytes] + for {set i 0} {$i < 5} {incr i} { + set vn {} + set res [testparsevar [append vn $ a([string repeat {[]} 19]) bar]] + if {$res ne {foo bar}} {error "Unexpected result: $res"} + + set tmp $end + set end [getbytes] + } + expr {$end - $tmp} +} -cleanup { + unset -nocomplain a end i vn res tmp + rename getbytes {} +} -result 0 test parse-14.1 {Tcl_ParseBraces procedure, computing string length} testparser { testparser [bytestring "foo\0 bar"] -1 @@ -1097,6 +1118,12 @@ test parse-21.0 {Bug 1884496} testevent { testevent queue a head $::script vwait done } {} +test parse-21.1 {TCL_EVAL_DIRECT coverage} testevent { + testevent queue a head {testevent delete a; \ + set ::done [dict get [info frame 0] line]} + vwait done + set ::done +} 2 cleanupTests } |