diff options
author | dgp <dgp@users.sourceforge.net> | 2007-09-09 19:28:30 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2007-09-09 19:28:30 (GMT) |
commit | 1aec3f216c9ebfc5dd9d7e8146dc452e9f76b7ae (patch) | |
tree | dc288f72c9331c09129c27b60b55930645fd7521 /tests/apply.test | |
parent | c751a324c1745d7c554ff34f1a85d4d18c2dfa86 (diff) | |
download | tcl-1aec3f216c9ebfc5dd9d7e8146dc452e9f76b7ae.zip tcl-1aec3f216c9ebfc5dd9d7e8146dc452e9f76b7ae.tar.gz tcl-1aec3f216c9ebfc5dd9d7e8146dc452e9f76b7ae.tar.bz2 |
* generic/tclInt.h: Removed the "nsName" Tcl_ObjType from the
* generic/tclNamesp.c: registered set. Revised the management of
* generic/tclObj.c: the intrep of that Tcl_ObjType. Revised the
* tests/obj.test: TclGetNamespaceFromObj() routine to return
TCL_ERROR and write a consistent error message when a namespace is
not found. [Bug 1588842. Patch 1686862]
***POTENTIAL INCOMPATIBILITY***
For callers of Tcl_GetObjType() on the name "nsName".
* generic/tclExecute.c: Update TclGetNamespaceFromObj() callers.
* generic/tclProc.c:
* tests/apply.test: Updated tests to expect new consistent
* tests/namespace-old.test: error message when a namespace is not
* tests/namespace.test: found.
* tests/upvar.test:
Diffstat (limited to 'tests/apply.test')
-rw-r--r-- | tests/apply.test | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/tests/apply.test b/tests/apply.test index 93c77a2..894aad3 100644 --- a/tests/apply.test +++ b/tests/apply.test @@ -12,10 +12,10 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: apply.test,v 1.10 2007/03/29 19:22:08 msofer Exp $ +# RCS: @(#) $Id: apply.test,v 1.11 2007/09/09 19:28:31 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest + package require tcltest 2.2 namespace import -force ::tcltest::* } @@ -79,32 +79,26 @@ test apply-2.5 {malformed lambda} { # Tests for runtime errors in the lambda expression -test apply-3.1 {non-existing namespace} { - set lambda [list x {set x 1} ::NONEXIST::FOR::SURE] - set res [catch {apply $lambda x} msg] - list $res $msg -} {1 {cannot find namespace "::NONEXIST::FOR::SURE"}} -test apply-3.2 {non-existing namespace} { +test apply-3.1 {non-existing namespace} -body { + apply [list x {set x 1} ::NONEXIST::FOR::SURE] x +} -returnCodes error -result {namespace "::NONEXIST::FOR::SURE" not found} +test apply-3.2 {non-existing namespace} -body { namespace eval ::NONEXIST::FOR::SURE {} set lambda [list x {set x 1} ::NONEXIST::FOR::SURE] apply $lambda x namespace delete ::NONEXIST - set res [catch {apply $lambda x} msg] - list $res $msg -} {1 {cannot find namespace "::NONEXIST::FOR::SURE"}} -test apply-3.3 {non-existing namespace} { - set lambda [list x {set x 1} NONEXIST::FOR::SURE] - set res [catch {apply $lambda x} msg] - list $res $msg -} {1 {cannot find namespace "::NONEXIST::FOR::SURE"}} -test apply-3.4 {non-existing namespace} { + apply $lambda x +} -returnCodes error -result {namespace "::NONEXIST::FOR::SURE" not found} +test apply-3.3 {non-existing namespace} -body { + apply [list x {set x 1} NONEXIST::FOR::SURE] x +} -returnCodes error -result {namespace "::NONEXIST::FOR::SURE" not found} +test apply-3.4 {non-existing namespace} -body { namespace eval ::NONEXIST::FOR::SURE {} set lambda [list x {set x 1} NONEXIST::FOR::SURE] apply $lambda x namespace delete ::NONEXIST - set res [catch {apply $lambda x} msg] - list $res $msg -} {1 {cannot find namespace "::NONEXIST::FOR::SURE"}} + apply $lambda x +} -returnCodes error -result {namespace "::NONEXIST::FOR::SURE" not found} test apply-4.1 {error in arguments to lambda expression} { set lambda [list x {set x 1}] |