summaryrefslogtreecommitdiffstats
path: root/tests/oo.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-05-15 10:08:02 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-05-15 10:08:02 (GMT)
commit11bd2610c43ddd48a8bbf6b2e594df74b4f2ac4c (patch)
tree5741aec073dba6d5081e376f592ba0c4e5c5bc5f /tests/oo.test
parentc17a6f4f80e5bb7dcdf8e5c1740443906d6ae89a (diff)
downloadtcl-11bd2610c43ddd48a8bbf6b2e594df74b4f2ac4c.zip
tcl-11bd2610c43ddd48a8bbf6b2e594df74b4f2ac4c.tar.gz
tcl-11bd2610c43ddd48a8bbf6b2e594df74b4f2ac4c.tar.bz2
Added more introspection: ability to look up namespace of an object.
Diffstat (limited to 'tests/oo.test')
-rw-r--r--tests/oo.test12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/oo.test b/tests/oo.test
index c8957b3..da295a6 100644
--- a/tests/oo.test
+++ b/tests/oo.test
@@ -7,7 +7,7 @@
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: oo.test,v 1.26 2009/05/08 08:48:19 dkf Exp $
+# RCS: @(#) $Id: oo.test,v 1.27 2009/05/15 10:08:02 dkf Exp $
package require TclOO 0.6.1 ;# Must match value in generic/tclOO.h
if {[lsearch [namespace children] ::tcltest] == -1} {
@@ -1319,7 +1319,7 @@ test oo-16.2 {OO: object introspection} -body {
} -returnCodes 1 -result {NOTANOBJECT does not refer to an object}
test oo-16.3 {OO: object introspection} -body {
info object gorp oo::object
-} -returnCodes 1 -result {unknown or ambiguous subcommand "gorp": must be class, definition, filters, forward, isa, methods, mixins, variables, or vars}
+} -returnCodes 1 -result {unknown or ambiguous subcommand "gorp": must be class, definition, filters, forward, isa, methods, mixins, namespace, variables, or vars}
test oo-16.4 {OO: object introspection} -setup {
oo::class create meta { superclass oo::class }
[meta create instance1] create instance2
@@ -1416,6 +1416,14 @@ test oo-16.12 {OO: object introspection} -setup {
oo::objdefine foo unexport {*}[info object methods foo -all]
info object methods foo -all
} -result {}
+test oo-16.13 {OO: object introspection} -setup {
+ oo::object create foo
+} -cleanup {
+ rename foo {}
+} -body {
+ oo::objdefine foo method Bar {} {return "ok in foo"}
+ [info object namespace foo]::my Bar
+} -result "ok in foo"
test oo-17.1 {OO: class introspection} -body {
info class