Index: TODO =================================================================== diff -u -r1a5cc7b02f162167f0d7ac22317b1711358673b8 -r086816f529d19d7ea2c7de455cbfe7c0d2f46643 --- TODO (.../TODO) (revision 1a5cc7b02f162167f0d7ac22317b1711358673b8) +++ TODO (.../TODO) (revision 086816f529d19d7ea2c7de455cbfe7c0d2f46643) @@ -1351,12 +1351,13 @@ - removed overhead on ::nsf::dispatch when called with absolute paths - absolute paths have to start with ":". -TODO: -- check equivalence of the following two commands +- checked equivalence of the following two commands in respect to fully-qualified names ::nsf::dispatch $obj ::nsf::cmd::ObjectInfo2::hastype $class ::nsf::parametercheck object,type=$class $obj + extended regression test (paramters.tcl) +TODO: - subcmd * handle sucmd for other method factories * handle absence of -create flag in resolve_method_path (for introspection) Index: tests/parameters.tcl =================================================================== diff -u -rf93a860bacabe371e1f01bd3f3841015c6b14a21 -r086816f529d19d7ea2c7de455cbfe7c0d2f46643 --- tests/parameters.tcl (.../parameters.tcl) (revision f93a860bacabe371e1f01bd3f3841015c6b14a21) +++ tests/parameters.tcl (.../parameters.tcl) (revision 086816f529d19d7ea2c7de455cbfe7c0d2f46643) @@ -1187,3 +1187,67 @@ ## TODO regression test for type checking, parameter options (initcmd, ## substdefault, combinations with defaults, ...), etc. +Test parameter count 100 + +Test case checktype { + nx::Object create o { + :method f01 {} {::nsf::dispatch o ::nsf::cmd::ObjectInfo::hastype ::nx::Object} + :method f02 {} {::nsf::dispatch o ::nsf::cmd::ObjectInfo::hastype nx::Object} + :method f03 {} {::nsf::dispatch o ::nsf::cmd::ObjectInfo::hastype Object} + + :method f11 {} {::nsf::is object,type=::nx::Object o} + :method f12 {} {::nsf::is object,type=nx::Object o} + :method f13 {} {::nsf::is object,type=Object o} + } + + ? {o f01} 1 + ? {o f02} 1 + ? {o f03} 1 + + ? {o f11} 1 + ? {o f12} 1 + ? {o f13} 1 +} + +namespace eval foo { + nx::Class create C { + :create c1 + :method f21 {} {::nsf::dispatch c1 ::nsf::cmd::ObjectInfo::hastype Object} + :method f22 {} {::nsf::dispatch c1 ::nsf::cmd::ObjectInfo::hastype C} + :method f31 {} {::nsf::is object,type=Object c1} + :method f32 {} {::nsf::is object,type=C c1} + } + + nx::Object create o { + :method f01 {} {::nsf::dispatch c1 ::nsf::cmd::ObjectInfo::hastype ::nx::Object} + :method f02 {} {::nsf::dispatch c1 ::nsf::cmd::ObjectInfo::hastype nx::Object} + :method f03 {} {::nsf::dispatch c1 ::nsf::cmd::ObjectInfo::hastype Object} + :method f04 {} {::nsf::dispatch c1 ::nsf::cmd::ObjectInfo::hastype foo::C} + :method f05 {} {::nsf::dispatch c1 ::nsf::cmd::ObjectInfo::hastype C} + + :method f11 {} {::nsf::is object,type=::nx::Object c1} + :method f12 {} {::nsf::is object,type=nx::Object c1} + :method f13 {} {::nsf::is object,type=Object c1} + :method f14 {} {::nsf::is object,type=foo::C c1} + :method f15 {} {::nsf::is object,type=C c1} + } + + ? {o f01} 1 + ? {o f02} 1 + ? {o f03} 1 + ? {o f04} 1 + ? {o f05} 1 + + ? {o f11} 1 + ? {o f12} 1 + ? {o f13} 1 + ? {o f14} 1 + ? {o f15} 1 + + ? {c1 f21} 1 + ? {c1 f22} 1 + ? {c1 f31} 1 + ? {c1 f32} 1 +} + +