summaryrefslogtreecommitdiffstats
path: root/tests/tcltest.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2004-11-02 19:03:04 (GMT)
committerdgp <dgp@users.sourceforge.net>2004-11-02 19:03:04 (GMT)
commit85b5881a0a77a3e3f640365026d6c8722f83c4df (patch)
tree43d52e5aac7dbc1f74096edb2e9afc91b6f30b1a /tests/tcltest.test
parent22950832b701d9cbc8f109de3cf39f70fe4745b3 (diff)
downloadtcl-85b5881a0a77a3e3f640365026d6c8722f83c4df.zip
tcl-85b5881a0a77a3e3f640365026d6c8722f83c4df.tar.gz
tcl-85b5881a0a77a3e3f640365026d6c8722f83c4df.tar.bz2
2004-11-02 Don Porter <dgp@users.sourceforge.net>
* library/tcltest/tcltest.tcl: Corrected some misleading * tests/tcltest.test (tcltest-26.1,2): displays of ::errorInfo and ::errorCode information when the -setup, -body, and/or -cleanup scripts return an unexpected return code. Thanks to Robert Seeger for the fix. [RFE 1017151].
Diffstat (limited to 'tests/tcltest.test')
-rwxr-xr-xtests/tcltest.test43
1 files changed, 42 insertions, 1 deletions
diff --git a/tests/tcltest.test b/tests/tcltest.test
index 90a87af..ae5332d 100755
--- a/tests/tcltest.test
+++ b/tests/tcltest.test
@@ -6,7 +6,7 @@
# Copyright (c) 2000 by Ajuba Solutions
# All rights reserved.
#
-# RCS: @(#) $Id: tcltest.test,v 1.37.2.5 2004/10/26 20:14:37 dgp Exp $
+# RCS: @(#) $Id: tcltest.test,v 1.37.2.6 2004/11/02 19:03:08 dgp Exp $
# Note that there are several places where the value of
# tcltest::currentFailure is stored/reset in the -setup/-cleanup
@@ -1740,6 +1740,47 @@ test tcltest-25.3 {
verbose $v
} -match glob -output {*generated error; Return code was: 1*}
+test tcltest-26.1 {Bug/RFE 1017151} -setup {
+ makeFile {
+ package require tcltest
+ set errorInfo "Should never see this"
+ tcltest::test tcltest-26.1.0 {
+ no errorInfo when only return code mismatch
+ } -body {
+ set x 1
+ } -returnCodes error -result 1
+ tcltest::cleanupTests
+ } test.tcl
+} -body {
+ slave msg test.tcl
+ set msg
+} -cleanup {
+ removeFile test.tcl
+} -match glob -result {*
+---- Return code should have been one of: 1
+==== tcltest-26.1.0 FAILED*}
+
+test tcltest-26.2 {Bug/RFE 1017151} -setup {
+ makeFile {
+ package require tcltest
+ set errorInfo "Should never see this"
+ tcltest::test tcltest-26.2.0 {do not mask body errorInfo} -body {
+ error "body error"
+ } -cleanup {
+ error "cleanup error"
+ } -result 1
+ tcltest::cleanupTests
+ } test.tcl
+} -body {
+ slave msg test.tcl
+ set msg
+} -cleanup {
+ removeFile test.tcl
+} -match glob -result {*
+---- errorInfo: body error
+*
+---- errorInfo(cleanup): cleanup error*}
+
cleanupTests
}