Index: generic/nsf.c =================================================================== diff -u -N -rc2e57257a55ea1fdc5306679e58da336c1bc3a5a -r0b1ac7f47948c36c4e03fc3d6dbce0a04d9418d4 --- generic/nsf.c (.../nsf.c) (revision c2e57257a55ea1fdc5306679e58da336c1bc3a5a) +++ generic/nsf.c (.../nsf.c) (revision 0b1ac7f47948c36c4e03fc3d6dbce0a04d9418d4) @@ -22275,7 +22275,7 @@ } case InfomethodsubcmdExistsIdx: { - Tcl_SetObjResult(interp, Tcl_NewIntObj(1)); + Tcl_SetObjResult(interp, Tcl_NewIntObj(!CmdIsNsfObject(cmd))); return TCL_OK; } case InfomethodsubcmdArgsIdx: Index: tests/info-method.test =================================================================== diff -u -N -r42ff96c3ae55cc30897aa03d2bf5029e51b21638 -r0b1ac7f47948c36c4e03fc3d6dbce0a04d9418d4 --- tests/info-method.test (.../info-method.test) (revision 42ff96c3ae55cc30897aa03d2bf5029e51b21638) +++ tests/info-method.test (.../info-method.test) (revision 0b1ac7f47948c36c4e03fc3d6dbce0a04d9418d4) @@ -646,8 +646,14 @@ # # test whether the handles for ensemble methods work # + ? {C info method exists "bar"} 1 + ? {C info method exists [C info method registrationhandle "bar"]} 1 ? {C info method parameters [C info method registrationhandle "bar"]} "" + + ? {C info method exists "bar b"} 1 + ? {C info method exists [C info method registrationhandle "bar b"]} 1 ? {C info method parameters [C info method registrationhandle "bar b"]} "x:int y:upper" + ? {C info method parameters [C info method registrationhandle "bar baz y"]} "x:int y:upper" # Index: tests/nsf-cmd.test =================================================================== diff -u -N -r714726da8aa70930a6f1f482e48ab98e4af0b88b -r0b1ac7f47948c36c4e03fc3d6dbce0a04d9418d4 --- tests/nsf-cmd.test (.../nsf-cmd.test) (revision 714726da8aa70930a6f1f482e48ab98e4af0b88b) +++ tests/nsf-cmd.test (.../nsf-cmd.test) (revision 0b1ac7f47948c36c4e03fc3d6dbce0a04d9418d4) @@ -179,6 +179,47 @@ ? {nsf::cmd::info postcondition $::handle} "" ? {nsf::cmd::info submethods $::handle} "" ? {nsf::cmd::info returns $::handle} "" + + # + # A plain NX object + # + set ::handle [nx::Object new] + + ? {nsf::cmd::info args $::handle} "" + ? {nsf::cmd::info body $::handle} "" + ? {nsf::cmd::info definition $::handle} "" + ? {nsf::cmd::info exists $::handle} 0 + ? {nsf::cmd::info registrationhandle $::handle} "" + ? {nsf::cmd::info definitionhandle $::handle} "" + ? {nsf::cmd::info origin $::handle} "" + ? {nsf::cmd::info parameter $::handle} "" + ? {nsf::cmd::info syntax $::handle} "" + ? {nsf::cmd::info type $::handle} "cmd" + ? {nsf::cmd::info precondition $::handle} "" + ? {nsf::cmd::info postcondition $::handle} "" + ? {nsf::cmd::info submethods $::handle} "" + ? {nsf::cmd::info returns $::handle} "" + + # + # A method handle for an ensemble + # + set ::handle [nx::Object info method registrationhandle "info"] + + ? {nsf::cmd::info args $::handle} "" + ? {nsf::cmd::info body $::handle} "" + ? {nsf::cmd::info definition $::handle} "::nx::Object public alias info ::nx::Object::slot::__info" + ? {nsf::cmd::info exists $::handle} 1 + ? {nsf::cmd::info registrationhandle $::handle} $::handle + ? {nsf::cmd::info definitionhandle $::handle} $::handle + ? {nsf::cmd::info origin $::handle} "::nx::Object::slot::__info" + ? {nsf::cmd::info parameter $::handle} "" + ? {nsf::cmd::info syntax $::handle} "" + ? {nsf::cmd::info type $::handle} "alias" + ? {nsf::cmd::info precondition $::handle} "" + ? {nsf::cmd::info postcondition $::handle} "" + ? {nsf::cmd::info submethods $::handle} [nx::Object info method submethods info] + ? {nsf::cmd::info returns $::handle} "" + }