summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2004-08-16 14:18:24 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2004-08-16 14:18:24 (GMT)
commitb0fd12960e73a75f19054c952e0f96b76f9034ca (patch)
treee499ed436b4b92db213ed5e5405a8db7b68a60b2 /tests
parentfcdb3fb3304b33b2a76e2e47d92cdd5c2ca4c145 (diff)
downloadtcl-b0fd12960e73a75f19054c952e0f96b76f9034ca.zip
tcl-b0fd12960e73a75f19054c952e0f96b76f9034ca.tar.gz
tcl-b0fd12960e73a75f19054c952e0f96b76f9034ca.tar.bz2
fix for [Bug 1008314]
Diffstat (limited to 'tests')
-rw-r--r--tests/result.test33
1 files changed, 28 insertions, 5 deletions
diff --git a/tests/result.test b/tests/result.test
index f0fb9e3..ec26b64 100644
--- a/tests/result.test
+++ b/tests/result.test
@@ -65,27 +65,50 @@ test result-3.2 {Tcl_DiscardInterpResult} {testsaveresult} {
testsaveresult free {set x 42} 1
} {42}
-test result-4.1 {Tcl_SetObjErrorCode - one arg} {testsaveresult} {
+::tcltest::testConstraint testsetobjerrorcode \
+ [expr {[info commands testsetobjerrorcode] != {}}]
+
+test result-4.1 {Tcl_SetObjErrorCode - one arg} {testsetobjerrorcode} {
catch {testsetobjerrorcode 1}
list [set errorCode]
} {1}
-test result-4.2 {Tcl_SetObjErrorCode - two args} {testsaveresult} {
+test result-4.2 {Tcl_SetObjErrorCode - two args} {testsetobjerrorcode} {
catch {testsetobjerrorcode 1 2}
list [set errorCode]
} {{1 2}}
-test result-4.3 {Tcl_SetObjErrorCode - three args} {testsaveresult} {
+test result-4.3 {Tcl_SetObjErrorCode - three args} {testsetobjerrorcode} {
catch {testsetobjerrorcode 1 2 3}
list [set errorCode]
} {{1 2 3}}
-test result-4.4 {Tcl_SetObjErrorCode - four args} {testsaveresult} {
+test result-4.4 {Tcl_SetObjErrorCode - four args} {testsetobjerrorcode} {
catch {testsetobjerrorcode 1 2 3 4}
list [set errorCode]
} {{1 2 3 4}}
-test result-4.5 {Tcl_SetObjErrorCode - five args} {testsaveresult} {
+test result-4.5 {Tcl_SetObjErrorCode - five args} {testsetobjerrorcode} {
catch {testsetobjerrorcode 1 2 3 4 5}
list [set errorCode]
} {{1 2 3 4 5}}
+::tcltest::testConstraint testseterrorcode \
+ [expr {[info commands testseterrorcode] != {}}]
+
+test result-5.1 {Tcl_SetErrorCode - one arg} testseterrorcode {
+ catch {testseterrorcode 1}
+ set errorCode
+} 1
+test result-5.2 {Tcl_SetErrorCode - one arg, list quoting} testseterrorcode {
+ catch {testseterrorcode {a b}}
+ set errorCode
+} {{a b}}
+test result-5.3 {Tcl_SetErrorCode - one arg, list quoting} testseterrorcode {
+ catch {testseterrorcode \{}
+ llength $errorCode
+} 1
+test result-5.4 {Tcl_SetErrorCode - two args, list quoting} testseterrorcode {
+ catch {testseterrorcode {a b} c}
+ set errorCode
+} {{a b} c}
+
# cleanup
::tcltest::cleanupTests
return