diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/oo.test | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/oo.test b/tests/oo.test index 7d328f6..2df1d4d 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.14 2008/09/26 20:16:39 dgp Exp $ +# RCS: @(#) $Id: oo.test,v 1.15 2008/10/10 13:04:09 dkf Exp $ package require TclOO 0.4 ;# Must match value in configure.in if {[lsearch [namespace children] ::tcltest] == -1} { @@ -316,6 +316,28 @@ test oo-4.4 {exporting a class method from an object} -setup { oo::objdefine testObject export Good testObject Good } -result ok +test oo-4.5 {export creates proper method entries} -setup { + oo::class create testClass +} -body { + oo::define testClass { + export foo + method foo {} {return ok} + } + [testClass new] foo +} -cleanup { + testClass destroy +} -result ok +test oo-4.6 {export creates proper method entries} -setup { + oo::class create testClass +} -body { + oo::define testClass { + unexport foo + method foo {} {return ok} + } + [testClass new] foo +} -cleanup { + testClass destroy +} -result ok test oo-5.1 {OO: manipulation of classes as objects} -setup { set obj [oo::object new] |