diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2008-06-19 21:29:02 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2008-06-19 21:29:02 (GMT) |
commit | 48bde53d60eb4631746456df0bd1e879c6a15628 (patch) | |
tree | 9865c18bcd5f93f18cbc931b62b13c329a89b915 /tests/oo.test | |
parent | 107e7f1dfc29d890846a46317dca00e49594393c (diff) | |
download | tcl-48bde53d60eb4631746456df0bd1e879c6a15628.zip tcl-48bde53d60eb4631746456df0bd1e879c6a15628.tar.gz tcl-48bde53d60eb4631746456df0bd1e879c6a15628.tar.bz2 |
Make [next] work as described in TIP. [Bug 1998244]
Diffstat (limited to 'tests/oo.test')
-rw-r--r-- | tests/oo.test | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/tests/oo.test b/tests/oo.test index 0362647..3f9fa94 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.6 2008/06/19 20:57:23 dkf Exp $ +# RCS: @(#) $Id: oo.test,v 1.7 2008/06/19 21:29:04 dkf Exp $ package require TclOO 0.4 ;# Must match value in configure.in if {[lsearch [namespace children] ::tcltest] == -1} { @@ -558,20 +558,20 @@ test oo-7.7 {OO: inheritance and errorInfo} -setup { (object "::c" method "foo" line 1) invoked from within "c foo"}} -test oo-7.8 {OO: next at the end of the method chain} { +test oo-7.8 {OO: next at the end of the method chain} -setup { + set ::result "" +} -cleanup { + foo destroy +} -body { oo::class create foo { - method bar {} {lappend ::result [next] foo} + method bar {} {lappend ::result foo; lappend ::result [next] foo} } oo::class create foo2 { superclass foo - method bar {} {lappend ::result [next] foo2} + method bar {} {lappend ::result foo2; lappend ::result [next] foo2} } - set o [foo2 new] - set ::result "" - catch {$o bar} - foo destroy - return $result -} {{} foo {{} foo} foo2} + lappend result [catch {[foo2 new] bar} msg] $msg +} -result {foo2 foo 1 {no next method implementation}} test oo-8.1 {OO: global must work in methods} { oo::object create foo @@ -1041,7 +1041,9 @@ test oo-14.7 {OO and filters from mixins of mixins} -setup { } -result {(foo) (bar) (egg) chicken (egg) (bar) (foo)} test oo-14.8 {OO: class mixin order - Bug 1998221} -setup { set ::result {} - oo::class create master + oo::class create master { + method test {} {} + } } -cleanup { master destroy } -body { |