summaryrefslogtreecommitdiffstats
path: root/tests/oo.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/oo.test')
-rw-r--r--tests/oo.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/oo.test b/tests/oo.test
index b2c269b..e49ecb3 100644
--- a/tests/oo.test
+++ b/tests/oo.test
@@ -4898,6 +4898,22 @@ test oo-41.2 {TIP 478: myclass command cleanup} -setup {
} -cleanup {
parent destroy
} -result {{this is ::cls1} {this is ::x} {this is ::x} {this is ::cls1} 1 1}
+test oo-41.3 {TIP 478: myclass command calls unexported methods, via forward} -setup {
+ oo::class create parent
+ set result {}
+} -body {
+ oo::class create cls1 {
+ superclass parent
+ self method Hi {} {
+ return "this is [self]"
+ }
+ forward poke myclass Hi
+ }
+ cls1 create x
+ lappend result [catch {cls1 Hi}] [x poke]
+} -cleanup {
+ parent destroy
+} -result {1 {this is ::cls1}}
cleanupTests
return