Index: tests/methods.test =================================================================== diff -u -N -r7e090d5c59743ecf7e8fd8d05d5130c5bce092db -r3ccbf1417d84765af57693523035ecf857e37428 --- tests/methods.test (.../methods.test) (revision 7e090d5c59743ecf7e8fd8d05d5130c5bce092db) +++ tests/methods.test (.../methods.test) (revision 3ccbf1417d84765af57693523035ecf857e37428) @@ -175,6 +175,7 @@ ? {c2 public_method} "public_method" ? {catch {c2 protected_method}} 1 ? {::nsf::dispatch c2 protected_method} "protected_method" + ? {info commands ::nsf::classes::C::public_method} ::nsf::classes::C::public_method } # class level forwards @@ -245,6 +246,7 @@ ? {c1 public_object_method} "public_object_method" ? {catch {c1 protected_object_method}} 1 ? {::nsf::dispatch c1 protected_object_method} "protected_object_method" + ? {info commands ::c1::public_object_method} ::c1::public_object_method } # object level forwards @@ -1276,6 +1278,33 @@ } +# +# Check, if the execution namespace after the builtin or +# serializer-based copy is correct. +# +nx::test case nx-copy-COPY-namespace { + nx::Object create o1 + nx::Object create o1::o { + :public object method foo {} {namespace current} + } + nx::Object create o2 + + ::nx::Object public method COPY {target} { + set code [::Serializer deepSerialize -objmap [list [self] $target] [self]] + #puts CODE=$code + eval $code + return [$target eval self] + } + + ? {o1::o foo} ::o1 + + ? {o1::o copy o2::o} ::o2::o + ? {o1::o COPY o2::O} ::o2::O + + ? {o2::o foo} ::o2 + ? {o2::O foo} ::o2 +} + nx::test case xotcl-COPY { package req XOTcl xotcl::Class create C