diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-12-08 16:23:09 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-12-08 16:23:09 (GMT) |
commit | e8bdd58fb25e1ff3478b71024e06d0d0099de5cd (patch) | |
tree | 04588e354e9166ce207a2a16b97556786d8e3976 /tests | |
parent | 9c58ff683434a73bf25755a7332e96f70cfcb0c5 (diff) | |
parent | d297273a132c164fb4df4d3cafda7201193fe9dc (diff) | |
download | tcl-e8bdd58fb25e1ff3478b71024e06d0d0099de5cd.zip tcl-e8bdd58fb25e1ff3478b71024e06d0d0099de5cd.tar.gz tcl-e8bdd58fb25e1ff3478b71024e06d0d0099de5cd.tar.bz2 |
merge trunk
Diffstat (limited to 'tests')
-rw-r--r-- | tests/compile.test | 12 | ||||
-rw-r--r-- | tests/parse.test | 3 | ||||
-rw-r--r-- | tests/parseExpr.test | 9 | ||||
-rw-r--r-- | tests/socket.test | 18 | ||||
-rw-r--r-- | tests/stringComp.test | 8 |
5 files changed, 48 insertions, 2 deletions
diff --git a/tests/compile.test b/tests/compile.test index 8b38541..f28dea2 100644 --- a/tests/compile.test +++ b/tests/compile.test @@ -455,14 +455,22 @@ test compile-13.1 {testing underestimate of maxStackSize in list cmd} {exec} { list [catch {exec [interpreter] << $script} msg] $msg } {0 OK} -# Special test for compiling tokens from a copy of the source string. [Bug -# 599788] +# Tests compile-14.* for [Bug 599788] [Bug 0c043a175a47da8c2342] test compile-14.1 {testing errors in element name; segfault?} {} { catch {set a([error])} msg1 catch {set bubba([join $abba $jubba]) $vol} msg2 list $msg1 $msg2 } {{wrong # args: should be "error message ?errorInfo? ?errorCode?"} {can't read "abba": no such variable}} +test compile-14.2 {testing element name "$"} -body { + unset -nocomplain a + set a() 1 + set a(1) 2 + set a($) 3 + list [set a()] [set a(1)] [set a($)] [unset a() a(1); lindex [array names a] 0] +} -cleanup {unset a} -result [list 1 2 3 {$}] + + # Tests compile-15.* cover Tcl Bug 633204 test compile-15.1 {proper TCL_RETURN code from [return]} { apply {{} {catch return}} diff --git a/tests/parse.test b/tests/parse.test index 5d8afeb..d73c725 100644 --- a/tests/parse.test +++ b/tests/parse.test @@ -663,6 +663,9 @@ test parse-12.24 {Tcl_ParseVarName procedure, missing close paren in array refer test parse-12.25 {Tcl_ParseVarName procedure, nested array reference} testparser { testparser {$x(a$y(b$z))} 0 } {- {$x(a$y(b$z))} 1 word {$x(a$y(b$z))} 8 variable {$x(a$y(b$z))} 7 text x 0 text a 0 variable {$y(b$z)} 4 text y 0 text b 0 variable {$z} 1 text z 0 {}} +test parse-12.26 {Tcl_ParseVarName [d2ffcca163] non-ascii} testparser { + testparser "$\u0433" -1 +} "- {$\u0433} 1 word {$\u0433} 2 text {$} 0 text \u0433 0 {}" test parse-13.1 {Tcl_ParseVar procedure} testparsevar { set abc 24 diff --git a/tests/parseExpr.test b/tests/parseExpr.test index e228a3b..0c91c59 100644 --- a/tests/parseExpr.test +++ b/tests/parseExpr.test @@ -1063,6 +1063,15 @@ test parseExpr-22.18 {Bug 3401704} -constraints testexprparser -body { dict get $o -errorcode } -result {TCL PARSE EXPR BADNUMBER BINARY} +test parseExpr-22.19 {Bug d2ffcca163} -constraints testexprparser -body { + testexprparser \u0433 -1 +} -returnCodes error -match glob -result {*invalid character*} +test parseExpr-22.20 {Bug d2ffcca163} -constraints testexprparser -body { + testexprparser \u043f -1 +} -returnCodes error -match glob -result {*invalid character*} +test parseExpr-22.21 {Bug d2ffcca163} -constraints testexprparser -body { + testexprparser in\u0433(0) -1 +} -returnCodes error -match glob -result {missing operand*} # cleanup cleanupTests diff --git a/tests/socket.test b/tests/socket.test index eeea044..4f90e51 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -2343,6 +2343,24 @@ test socket-14.17 {empty -sockname while [socket -async] connecting} \ catch {close $client} } -result {} +# test for bug c6ed4acfd8: running async socket connect with other connect +# established will block tcl as it goes in an infinite loop in vwait +test socket-14.18 {bug c6ed4acfd8: running async socket connect made other connect block} \ + -constraints {socket} \ + -body { + proc accept {channel address port} {} + set port [randport] + set ssock [socket -server accept $port] + set csock1 [socket -async localhost [randport]] + set csock2 [socket localhost $port] + after 1000 {set done ok} + vwait done +} -cleanup { + catch {close $ssock} + catch {close $csock1} + catch {close $csock2} + } -result {} + set num 0 set x {localhost {socket} 127.0.0.1 {supported_inet} ::1 {supported_inet6}} diff --git a/tests/stringComp.test b/tests/stringComp.test index 31c5b71..f5ba002 100644 --- a/tests/stringComp.test +++ b/tests/stringComp.test @@ -720,6 +720,14 @@ test stringComp-14.2 {Bug 82e7f67325} memory { }} {a b} } } {0} +test stringComp-14.3 {Bug 0dca3bfa8f} { + apply {arg { + set argCopy $arg + set arg [string replace $arg 1 2 aa] + # Crashes in comparison before fix + expr {$arg ne $argCopy} + }} abcde +} 1 ## string tolower ## not yet bc |