Index: tests/interceptor-slot.test =================================================================== diff -u -r994c14a5b0e1d662fc4f903f097ed0ee7a130986 -reea18b07ddfc917545d48ab6a272c0bfb9656f07 --- tests/interceptor-slot.test (.../interceptor-slot.test) (revision 994c14a5b0e1d662fc4f903f097ed0ee7a130986) +++ tests/interceptor-slot.test (.../interceptor-slot.test) (revision eea18b07ddfc917545d48ab6a272c0bfb9656f07) @@ -553,7 +553,7 @@ # # ... and we register it together with a guard. # - :filter add {loggingFilter { + :filter add {loggingFilter -guard { [current calledmethod] in {enter leave} }} } @@ -625,7 +625,45 @@ ? {d1 info lookup mixins} "::M2 ::M3" } + # +# Test potential confusion in case a class has a space in its name +# when registering methods or mixins. +# + +nx::test case space-in-classname { + nx::Class create M1 { + :public method foo {} {return "[next] [current class]"} + } + + # + # Define a class with a space in its name, containing a method. This + # class will be used as a mixin class later on. + # + nx::Class create "M1 b" -superclass M1 { + :public method foo {} {return next-[current class]} + } + + nx::Class create C { + :public method foo {} {return foo} + :create c1 + } + + # Test the base case + ? {c1 foo} foo + + # Add spacy class as a mixin. Check, if the introspection returns + # sensible values. + ? {C mixin add "M1 b"} "{::M1 b}" + ? {C info mixin classes} "{::M1 b}" + ? {M1 info mixin classes} "" + ? {M1 info mixinof} "" + ? {"M1 b" info mixin classes} "" + + # check the result of the mixin class + ? {c1 foo} "next-::M1 b" +} +# # Local variables: # mode: tcl # tcl-indent-level: 2