summaryrefslogtreecommitdiffstats
path: root/tests/oo.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-01-27 11:11:44 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-01-27 11:11:44 (GMT)
commit960bd1422f5ba24fa513f9738934538ab3140c73 (patch)
tree134e578f0c907dd96a6f92f6c5f3ce1bef0ca0cb /tests/oo.test
parent038ad9c8c8c8a7c63a58858d7693942420d5babd (diff)
downloadtcl-960bd1422f5ba24fa513f9738934538ab3140c73.zip
tcl-960bd1422f5ba24fa513f9738934538ab3140c73.tar.gz
tcl-960bd1422f5ba24fa513f9738934538ab3140c73.tar.bz2
Fix [Bug 2531577]
Diffstat (limited to 'tests/oo.test')
-rw-r--r--tests/oo.test23
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/oo.test b/tests/oo.test
index b7029ea..5db928e 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.20 2009/01/07 11:58:08 dkf Exp $
+# RCS: @(#) $Id: oo.test,v 1.21 2009/01/27 11:11:47 dkf Exp $
package require TclOO 0.6.1 ;# Must match value in generic/tclOO.h
if {[lsearch [namespace children] ::tcltest] == -1} {
@@ -245,6 +245,27 @@ test oo-2.2 {basic test of OO functionality: constructor} {
testClass destroy
return $result
} {::foo->construct ::foo->bar}
+test oo-2.4 {OO constructor - Bug 2531577} -setup {
+ oo::class create foo
+} -body {
+ oo::define foo constructor {} return
+ [foo new] destroy
+ oo::define foo constructor {} {}
+ llength [info command [foo new]]
+} -cleanup {
+ foo destroy
+} -result 1
+test oo-2.5 {OO constructor - Bug 2531577} -setup {
+ oo::class create foo
+ set result {}
+} -body {
+ oo::define foo constructor {} {error x}
+ lappend result [catch {foo new}]
+ oo::define foo constructor {} {}
+ lappend result [llength [info command [foo new]]]
+} -cleanup {
+ foo destroy
+} -result {1 1}
test oo-3.1 {basic test of OO functionality: destructor} -setup {
# This is a bit complex because it needs to run in a sub-interp as