Index: Makefile.in =================================================================== diff -u -rc72f9f638677608fab1502cd696c8f2d6b2952f9 -r8076a9474c34a6690da9109e353ee7dcea190ea5 --- Makefile.in (.../Makefile.in) (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) +++ Makefile.in (.../Makefile.in) (revision 8076a9474c34a6690da9109e353ee7dcea190ea5) @@ -350,6 +350,8 @@ -libdir $(PLATFORM_DIR) $(TESTFLAGS) $(TCLSH) $(src_test_dir_native)/slottest.xotcl \ -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_test_dir_native)/mixinoftest.xotcl \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) test-http: $(TCLSH_PROG) $(TCLSH) $(src_test_dir_native)/xocomm.test \ Index: tests/mixinoftest.xotcl =================================================================== diff -u --- tests/mixinoftest.xotcl (revision 0) +++ tests/mixinoftest.xotcl (revision 8076a9474c34a6690da9109e353ee7dcea190ea5) @@ -0,0 +1,64 @@ +# testing mixinof +package require XOTcl +namespace import -force xotcl::* +package require xotcl::test + +proc ? {cmd expected} { + set t [Test new -cmd $cmd] + $t expected $expected + $t run +} + +########################################### +# testing simple per object mixins +########################################### +Class A +Object o -mixin A +? {o mixin} ::A +? {o info mixin} ::A +? {A info mixinof} ::o + +o destroy +? {A info mixinof} "" + +A destroy + +########################################### +# testing per object mixins with redefinition +########################################### +Class M -instproc foo args {puts x;next} +Object o -mixin M + +? {o info mixin} ::M +? {o info precedence} "::M ::xotcl::Object" +? {o procsearch foo} "::M instproc foo" + +Class M -instproc foo args next +? {o info mixin} ::M +? {o info precedence} "::M ::xotcl::Object" +? {o procsearch foo} "::M instproc foo" + +M destroy +? {o info mixin} "" +? {o info precedence} "::xotcl::Object" +? {o procsearch foo} "" + +o destroy + +########################################### +# testing simple per class mixins +########################################### +Class A +Class B -instmixin A +Class C -superclass B +C c1 +? {B instmixin} ::A +? {B info instmixin} ::A +? {A info instmixinof} ::B +? {c1 info precedence} "::A ::C ::B ::xotcl::Object" + +B destroy +? {A info instmixinof} "" +? {c1 info precedence} "::C ::xotcl::Object" + +A destroy