TclOO Package

Check-in [568146bba2]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Tests from Bug 3610404 but constrained with knownBug because of a problem that is probably in Tcl 8.5 itself. It's believed that TclOO in 8.5 is otherwise unaffected by bug 3610404.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 568146bba2cc53ed0522ebe17728738784d887d7
User & Date: dkf 2013-04-10 09:12:37
Original Comment: Tests from [Bug 3610404] but constrained with knownBug because of problem that is probably in Tcl 8.5 itself. It's believed that TclOO in 8.5 is otherwise unaffected by bug 3610404.
Context
2013-08-03
14:05
Backport of fix for Bug 9d61624b3d from Tcl build. Make build clean on OSX Mountain Lion. check-in: 66e3d9d210 user: dkf tags: trunk
2013-04-10
09:12
Tests from Bug 3610404 but constrained with knownBug because of a problem that is probably in Tcl 8.5 itself. It's believed that TclOO in 8.5 is otherwise unaffected by bug 3610404. check-in: 568146bba2 user: dkf tags: trunk
2013-02-09
12:38
Bug 3603695: Change the way that the [oo::object] 'varname' method is implemented so that there are no longer problems with interactions due to the resolver. Thanks to Taylor Venable <[email protected]> for identifying the problem.

Note that due to some subtleties, this test was not failing in the packaged version of TclOO. The code is backported anyway though, as it is rather cleaner than the previous version. check-in: ef16735886 user: dkf tags: trunk

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/oo.test.

876
877
878
879
880
881
882































































883
884
885
886
887
888
889
    oo::define fooClass {
	forward len  string length
    }
    [fooClass create foo] len a b
} -returnCodes error -cleanup {
    fooClass destroy
} -result {wrong # args: should be "::foo len string"}
































































test oo-7.1 {OO: inheritance 101} -setup {
    oo::class create superClass
    oo::class create subClass
    subClass create instance
} -body {
    oo::define superClass method doit x {lappend ::result $x}






>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
    oo::define fooClass {
	forward len  string length
    }
    [fooClass create foo] len a b
} -returnCodes error -cleanup {
    fooClass destroy
} -result {wrong # args: should be "::foo len string"}
test oo-6.19 {Bug 3610404: forwarding resolution + traces} -setup {
    oo::object create foo
    unset -nocomplain ::result
    set ::result {}
} -constraints knownBug -body {
    proc ::my {method} {lappend ::result global}
    oo::objdefine foo {
	method target {} {lappend ::result instance}
	forward bar my target
	method bump {} {
	    set ns [info object namespace ::foo]
	    rename ${ns}::my ${ns}::
	    rename ${ns}:: ${ns}::my
	}
    }
    proc harness {} {
	foo target
	foo bar
	foo target
    }
    trace add execution harness enterstep {apply {{cmd args} {foo bump}}}
    foo target
    foo bar
    foo bump
    foo bar
    harness
} -cleanup {
    catch {rename harness {}}
    catch {rename ::my {}}
    foo destroy
} -result {instance instance instance instance instance instance}
test oo-6.20 {Bug 3610404: forwarding resolution + traces} -setup {
    oo::class create fooClass
    fooClass create foo
    unset -nocomplain ::result
    set ::result {}
} -constraints knownBug -body {
    proc ::my {method} {lappend ::result global}
    oo::define fooClass {
	method target {} {lappend ::result class}
	forward bar my target
	method bump {} {
	    set ns [info object namespace [self]]
	    rename ${ns}::my ${ns}::
	    rename ${ns}:: ${ns}::my
	}
    }
    proc harness {} {
	foo target
	foo bar
	foo target
    }
    trace add execution harness enterstep {apply {{cmd args} {foo bump}}}
    foo target
    foo bar
    foo bump
    foo bar
    harness
} -cleanup {
    catch {rename harness {}}
    catch {rename ::my {}}
    fooClass destroy
} -result {class class class class class class}

test oo-7.1 {OO: inheritance 101} -setup {
    oo::class create superClass
    oo::class create subClass
    subClass create instance
} -body {
    oo::define superClass method doit x {lappend ::result $x}