summaryrefslogtreecommitdiffstats
path: root/tests/oo.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2017-03-29 19:16:32 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2017-03-29 19:16:32 (GMT)
commitc552943f9e361bd0e1facefafda71d3af4f991f3 (patch)
tree7860640334b407827cb96b3ad04c386516a1ab39 /tests/oo.test
parent24f5b98e8c8a4d160980f769e07bebe60f286eee (diff)
downloadtcl-c552943f9e361bd0e1facefafda71d3af4f991f3.zip
tcl-c552943f9e361bd0e1facefafda71d3af4f991f3.tar.gz
tcl-c552943f9e361bd0e1facefafda71d3af4f991f3.tar.bz2
[900cb0284bc] Ensure that masking pseudo-methods used for export management are not introspectable directly. [cherrypick]
Diffstat (limited to 'tests/oo.test')
-rw-r--r--tests/oo.test37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/oo.test b/tests/oo.test
index 2601c37..cb37a76 100644
--- a/tests/oo.test
+++ b/tests/oo.test
@@ -2241,6 +2241,43 @@ test oo-17.10 {OO: class introspection} -setup {
oo::define foo unexport {*}[info class methods foo -all]
info class methods foo -all
} -result {}
+set stdmethods {<cloned> destroy eval unknown variable varname}
+test oo-17.11 {OO: object method unexport (bug 900cb0284bc)} -setup {
+ oo::object create o
+ oo::objdefine o unexport m
+} -body {
+ lsort [info object methods o -all -private]
+} -cleanup {
+ o destroy
+} -result $stdmethods
+test oo-17.12 {OO: instance method unexport (bug 900cb0284bc)} -setup {
+ oo::class create c
+ c create o
+ oo::objdefine o unexport m
+} -body {
+ lsort [info object methods o -all -private]
+} -cleanup {
+ o destroy
+ c destroy
+} -result $stdmethods
+test oo-17.13 {OO: class method unexport (bug 900cb0284bc)} -setup {
+ oo::class create c
+ oo::define c unexport m
+} -body {
+ lsort [info class methods c -all -private]
+} -cleanup {
+ c destroy
+} -result $stdmethods
+test oo-17.14 {OO: instance method unexport (bug 900cb0284bc)} -setup {
+ oo::class create c
+ oo::define c unexport m
+ c create o
+} -body {
+ lsort [info object methods o -all -private]
+} -cleanup {
+ o destroy
+ c destroy
+} -result $stdmethods
test oo-18.1 {OO: define command support} {
list [catch {oo::define oo::object {error foo}} msg] $msg $errorInfo