Index: TODO =================================================================== diff -u -r6d831cc09c3eea83a17baa5ef05dfeb79b05836e -r59e100d383b22ea1407f5e5c40e303f2c6bb9027 --- TODO (.../TODO) (revision 6d831cc09c3eea83a17baa5ef05dfeb79b05836e) +++ TODO (.../TODO) (revision 59e100d383b22ea1407f5e5c40e303f2c6bb9027) @@ -3852,8 +3852,11 @@ - direct subobjects of objects are currently on dispatchable when allowmethoddispatch is set. Note, that this could be seen as a method-property of the method-name, which - could be made "private" as well to avoud such dispatches. + could be made "private" as well to avoud such direct dispatches. +- nsf.c: start all error messages with a lower case word for consistency + and to follow closer to Tcl's conventions + ======================================================================== TODO: - corollary: for complete configurability of method dispatch, we would Index: generic/nsf.c =================================================================== diff -u -r6d831cc09c3eea83a17baa5ef05dfeb79b05836e -r59e100d383b22ea1407f5e5c40e303f2c6bb9027 --- generic/nsf.c (.../nsf.c) (revision 6d831cc09c3eea83a17baa5ef05dfeb79b05836e) +++ generic/nsf.c (.../nsf.c) (revision 59e100d383b22ea1407f5e5c40e303f2c6bb9027) @@ -4829,8 +4829,8 @@ */ Tcl_Obj *bootstrapObj = Tcl_GetVar2Ex(interp, "::nsf::bootstrap", NULL, TCL_GLOBAL_ONLY); if (bootstrapObj == NULL) { - result = NsfPrintError(interp, "Method '%s' of %s cannot be overwritten. " - "Derive e.g. a sub-class!", methodName, ObjectName(object)); + result = NsfPrintError(interp, "method '%s' of %s cannot be overwritten; " + "derive e.g. a sub-class!", methodName, ObjectName(object)); } else { result = TCL_OK; } @@ -5717,12 +5717,12 @@ if (acResult == TCL_ERROR) { Tcl_Obj *sr = Tcl_GetObjResult(interp); INCR_REF_COUNT(sr); - NsfPrintError(interp, "Error in Assertion: {%s} in proc '%s'\n%s", + NsfPrintError(interp, "error in Assertion: {%s} in proc '%s'\n%s", ObjStr(checkFailed->content), methodName, ObjStr(sr)); DECR_REF_COUNT(sr); return TCL_ERROR; } - return NsfPrintError(interp, "Assertion failed check: {%s} in proc '%s'", + return NsfPrintError(interp, "assertion failed check: {%s} in proc '%s'", ObjStr(checkFailed->content), methodName); } @@ -5830,7 +5830,7 @@ } } if (opt->checkoptions == CHECK_NONE && ocArgs>0) { - return NsfPrintError(interp, "Unknown check option in command '%s' check %s, ", + return NsfPrintError(interp, "unknown check option in command '%s' check %s, ", "valid: all pre post object-invar class-invar", ObjectName(object), ObjStr(arg)); } @@ -7389,7 +7389,7 @@ } else if (result == TCL_ERROR) { Tcl_Obj *sr = Tcl_GetObjResult(interp); INCR_REF_COUNT(sr); - NsfPrintError(interp, "Guard Error: '%s'\n%s", ObjStr(guardObj), ObjStr(sr)); + NsfPrintError(interp, "Guard error: '%s'\n%s", ObjStr(guardObj), ObjStr(sr)); DECR_REF_COUNT(sr); return TCL_ERROR; } @@ -9475,7 +9475,7 @@ } NsfCleanupObject(invokedObject, "alias-delete1"); - return NsfPrintError(interp, "Trying to dispatch deleted object via method '%s'", + return NsfPrintError(interp, "trying to dispatch deleted object via method '%s'", methodName); } @@ -10141,7 +10141,7 @@ NsfCallStackContent *cscPtr1 = CallStackGetTopFrame0(interp); if (unlikely(cscPtr1 == NULL)) { - return NsfPrintError(interp, "Flag '-local' only allowed when called from a method body"); + return NsfPrintError(interp, "flag '-local' only allowed when called from a method body"); } if (cscPtr1->cl) { cmd = FindMethod(cscPtr1->cl->nsPtr, methodName); @@ -10948,7 +10948,7 @@ * In order to flag a warning, we set the error message and * return TCL_CONTINUE */ - (void)NsfPrintError(interp, "Value '%s' of parameter '%s' could be a non-positional argument", + (void)NsfPrintError(interp, "value '%s' of parameter '%s' could be a non-positional argument", value, pPtr->name); result = TCL_CONTINUE; } @@ -11441,7 +11441,7 @@ ParamOptionSetConverter(Tcl_Interp *interp, Nsf_Param *paramPtr, CONST char *typeName, Nsf_TypeConverter *converter) { if (paramPtr->converter) { - return NsfPrintError(interp, "Refuse to redefine parameter type of '%s' from type '%s' to type '%s'", + return NsfPrintError(interp, "refuse to redefine parameter type of '%s' from type '%s' to type '%s'", paramPtr->name, paramPtr->type, typeName); } paramPtr->converter = converter; @@ -11527,27 +11527,27 @@ } else if (strncmp(option, "noleadingdash", 13) == 0) { if (*paramPtr->name == '-') { - return NsfPrintError(interp, "Parameter option 'noleadingdash' only allowed for positional parameters"); + return NsfPrintError(interp, "parameter option 'noleadingdash' only allowed for positional parameters"); } paramPtr->flags |= NSF_ARG_NOLEADINGDASH; } else if (strncmp(option, "noconfig", 8) == 0) { if (disallowedOptions != NSF_DISALLOWED_ARG_OBJECT_PARAMETER) { - return NsfPrintError(interp, "Parameter option 'noconfig' only allowed for object parameters"); + return NsfPrintError(interp, "parameter option 'noconfig' only allowed for object parameters"); } paramPtr->flags |= NSF_ARG_NOCONFIG; } else if (strncmp(option, "args", 4) == 0) { if ((paramPtr->flags & NSF_ARG_ALIAS) == 0) { - return NsfPrintError(interp, "Parameter option \"args\" only allowed for parameter type \"alias\""); + return NsfPrintError(interp, "parameter option \"args\" only allowed for parameter type \"alias\""); } result = ParamOptionSetConverter(interp, paramPtr, "args", ConvertToNothing); } else if (optionLength >= 4 && strncmp(option, "arg=", 4) == 0) { if (paramPtr->converter != ConvertViaCmd) { fprintf(stderr, "type %s flags %.6x\n", paramPtr->type, paramPtr->flags); return NsfPrintError(interp, - "Parameter option 'arg=' only allowed for user-defined converter"); + "parameter option 'arg=' only allowed for user-defined converter"); } if (paramPtr->converterArg) {DECR_REF_COUNT(paramPtr->converterArg);} paramPtr->converterArg = Tcl_NewStringObj(option + 4, optionLength - 4); @@ -11560,7 +11560,7 @@ "type \"switch\" only allowed for non-positional arguments", paramPtr->name); } else if (paramPtr->flags & NSF_ARG_METHOD_INVOCATION) { - return NsfPrintError(interp, "Parameter invocation types cannot be used with option 'switch'"); + return NsfPrintError(interp, "parameter invocation types cannot be used with option 'switch'"); } result = ParamOptionSetConverter(interp, paramPtr, "switch", Nsf_ConvertToSwitch); paramPtr->flags |= NSF_ARG_SWITCH; @@ -11604,7 +11604,7 @@ } else if (optionLength >= 6 && strncmp(option, "type=", 5) == 0) { if (paramPtr->converter != Nsf_ConvertToObject && paramPtr->converter != Nsf_ConvertToClass) - return NsfPrintError(interp, "Parameter option 'type=' only allowed for parameter types 'object' and 'class'"); + return NsfPrintError(interp, "parameter option 'type=' only allowed for parameter types 'object' and 'class'"); if (paramPtr->converterArg) {DECR_REF_COUNT(paramPtr->converterArg);} paramPtr->converterArg = Tcl_NewStringObj(option + 5, optionLength - 5); INCR_REF_COUNT(paramPtr->converterArg); @@ -11616,7 +11616,7 @@ } else if (optionLength >= 6 && strncmp(option, "method=", 7) == 0) { if ((paramPtr->flags & (NSF_ARG_ALIAS|NSF_ARG_FORWARD)) == 0) { - return NsfPrintError(interp, "Parameter option 'method=' only allowed for parameter types 'alias' and 'forward'"); + return NsfPrintError(interp, "parameter option 'method=' only allowed for parameter types 'alias' and 'forward'"); } if (paramPtr->method) {DECR_REF_COUNT(paramPtr->method);} paramPtr->method = Tcl_NewStringObj(option + 7, optionLength - 7); @@ -11629,7 +11629,7 @@ Tcl_DStringAppend(dsPtr, option, optionLength); if (paramPtr->converter) { - NsfPrintError(interp, "Parameter option '%s' unknown for parameter type '%s'", + NsfPrintError(interp, "parameter option '%s' unknown for parameter type '%s'", Tcl_DStringValue(dsPtr), paramPtr->type); Tcl_DStringFree(dsPtr); return TCL_ERROR; @@ -11684,17 +11684,17 @@ } if ((paramPtr->flags & disallowedOptions)) { - return NsfPrintError(interp, "Parameter option '%s' not allowed", option); + return NsfPrintError(interp, "parameter option '%s' not allowed", option); } if (unlikely((paramPtr->flags & NSF_ARG_METHOD_INVOCATION) && (paramPtr->flags & NSF_ARG_NOCONFIG))) { - return NsfPrintError(interp, "Option 'noconfig' cannot used together with this type of object parameter"); + return NsfPrintError(interp, "option 'noconfig' cannot used together with this type of object parameter"); } else if (unlikely((paramPtr->flags & (NSF_ARG_ALIAS|NSF_ARG_FORWARD)) == (NSF_ARG_ALIAS|NSF_ARG_FORWARD))) { - return NsfPrintError(interp, "Parameter types 'alias' and 'forward' cannot be used together"); + return NsfPrintError(interp, "parameter types 'alias' and 'forward' cannot be used together"); } else if (unlikely((paramPtr->flags & (NSF_ARG_ALIAS|NSF_ARG_INITCMD)) == (NSF_ARG_ALIAS|NSF_ARG_INITCMD))) { - return NsfPrintError(interp, "Parameter types 'alias' and 'initcmd' cannot be used together"); + return NsfPrintError(interp, "parameter types 'alias' and 'initcmd' cannot be used together"); } else if (unlikely((paramPtr->flags & (NSF_ARG_FORWARD|NSF_ARG_INITCMD)) == (NSF_ARG_FORWARD|NSF_ARG_INITCMD))) { - return NsfPrintError(interp, "Parameter types 'forward' and 'initcmd' cannot be used together"); + return NsfPrintError(interp, "parameter types 'forward' and 'initcmd' cannot be used together"); } return result; @@ -11845,7 +11845,7 @@ } else if (paramPtr->converter == ConvertToNothing) { if (paramPtr->flags & (NSF_ARG_ALLOW_EMPTY|NSF_ARG_MULTIVALUED)) { NsfPrintError(interp, - "Multiplicity settings for variable argument parameter \"%s\" not allowed", + "multiplicity settings for variable argument parameter \"%s\" not allowed", paramPtr->name); goto param_error; } @@ -16518,7 +16518,7 @@ if (procNameObj->refCount != refcountBefore) { pcPtr->objc = nrParams ; /*fprintf(stderr, "trigger error pcPtr->objc %d\n", pcPtr->objc);*/ - return NsfPrintError(interp, "Unknown handler for '%s' must not alter definition", + return NsfPrintError(interp, "unknown handler for '%s' must not alter definition", ObjStr(argumentObj)); } #endif @@ -16563,7 +16563,7 @@ o++; if (unlikely(o >= objc)) { /* we expect an argument, but we are already at the end of the argument list */ - return NsfPrintError(interp, "Value for parameter '%s' expected", pPtr->name); + return NsfPrintError(interp, "value for parameter '%s' expected", pPtr->name); } assert(valueObj == NULL); valueObj = objv[o]; @@ -17966,7 +17966,7 @@ /*fprintf(stderr, "aliasGet methodName '%s' returns %p\n", methodName, obj);*/ Tcl_DStringFree(dsPtr); if (obj == NULL && leaveError) { - NsfPrintError(interp, "Could not obtain alias definition for %s %s.", + NsfPrintError(interp, "could not obtain alias definition for %s %s.", ObjStr(cmdName), methodName); } return obj; @@ -18647,7 +18647,7 @@ */ slave = Tcl_GetSlave(interp, ObjStr(objv[2])); if (!slave) { - return NsfPrintError(interp, "Creation of slave interpreter failed"); + return NsfPrintError(interp, "creation of slave interpreter failed"); } if (Nsf_Init(slave) == TCL_ERROR) { return TCL_ERROR; @@ -19101,7 +19101,7 @@ if (unlikely(cmd == NULL)) { - return NsfPrintError(interp, "Cannot lookup %s method '%s' for %s", + return NsfPrintError(interp, "cannot lookup %s method '%s' for %s", cl == 0 ? "object " : "", methodName, ObjectName(object)); } @@ -19183,7 +19183,7 @@ Tcl_Obj **objPtr; if (valueObj == NULL && methodproperty == MethodpropertySlotobjIdx) { - return NsfPrintError(interp, "Option 'slotobj' of method '%s' requires argument", + return NsfPrintError(interp, "option 'slotobj' of method '%s' requires argument", methodName); } @@ -19590,7 +19590,7 @@ if (oc % 2) { ObjectSystemFree(interp, osPtr); - return NsfPrintError(interp, "System methods must be provided as pairs"); + return NsfPrintError(interp, "system methods must be provided as pairs"); } for (i=0; iosPtr = osPtr; @@ -19916,7 +19916,7 @@ DECR_REF_COUNT(newFullCmdName); DECR_REF_COUNT(oldFullCmdName); DECR_REF_COUNT(arglistObj); - return NsfPrintError(interp, "No object for assertions"); + return NsfPrintError(interp, "no object for assertions"); } DSTRING_INIT(dsPtr); @@ -20448,7 +20448,7 @@ CONST char *procName = Tcl_GetCommandName(interp, cscPtr->cmdPtr); Tcl_SetResult(interp, (char *)procName, TCL_VOLATILE); } else { - return NsfPrintError(interp, "Can't find proc"); + return NsfPrintError(interp, "can't find proc"); } break; @@ -21020,7 +21020,7 @@ return TCL_OK; } - return NsfPrintError(interp, "Autoname failed. Probably format string (with %%) was not well-formed"); + return NsfPrintError(interp, "autoname failed. Probably format string (with %%) was not well-formed"); } /* @@ -21462,7 +21462,7 @@ */ if (unlikely(IsBaseClass(object))) { if (RUNTIME_STATE(interp)->exitHandlerDestroyRound != NSF_EXITHANDLER_ON_SOFT_DESTROY) { - return NsfPrintError(interp, "Cannot destroy base class %s", ObjectName(object)); + return NsfPrintError(interp, "cannot destroy base class %s", ObjectName(object)); } } @@ -21551,7 +21551,7 @@ } } - return NsfPrintError(interp, "Filterguard: can't find filter %s on %s", + return NsfPrintError(interp, "filterguard: can't find filter %s on %s", filter, ObjectName(object)); } @@ -21610,7 +21610,7 @@ } } - return NsfPrintError(interp, "Mixinguard: can't find mixin %s on %s", + return NsfPrintError(interp, "mixinguard: can't find mixin %s on %s", ObjStr(mixin), ObjectName(object)); } @@ -21854,8 +21854,8 @@ callFrameContext ctx = {0, NULL, NULL}; if (unlikely(RUNTIME_STATE(interp)->exitHandlerDestroyRound != NSF_EXITHANDLER_OFF)) { - fprintf(stderr, "### Can't make objects volatile during shutdown\n"); - return NsfPrintError(interp, "Can't make objects volatile during shutdown"); + fprintf(stderr, "### can't make objects volatile during shutdown\n"); + return NsfPrintError(interp, "can't make objects volatile during shutdown"); } CallStackUseActiveFrame(interp, &ctx); @@ -21906,7 +21906,7 @@ /*fprintf(stderr, " **** class '%s' wants to alloc '%s'\n", ClassName(cl), nameString);*/ if (unlikely(NSCheckColons(nameString, 0) == 0)) { - return NsfPrintError(interp, "Cannot allocate object - illegal name '%s'", nameString); + return NsfPrintError(interp, "cannot allocate object - illegal name '%s'", nameString); } if (IsMetaClass(interp, cl, 1) == 0) { @@ -21953,7 +21953,7 @@ /*fprintf(stderr, " **** class '%s' wants to alloc '%s'\n", ClassName(cl), nameString);*/ if (!NSCheckColons(nameString, 0)) { - return NsfPrintError(interp, "Cannot allocate object - illegal name '%s'", nameString); + return NsfPrintError(interp, "cannot allocate object - illegal name '%s'", nameString); } /* @@ -22048,7 +22048,7 @@ * Provide protection against recreation if base classes. */ if (unlikely(newObject && unlikely(IsBaseClass(newObject)))) { - result = NsfPrintError(interp, "Cannot recreate base class %s", ObjectName(newObject)); + result = NsfPrintError(interp, "cannot recreate base class %s", ObjectName(newObject)); goto create_method_exit; } @@ -22140,7 +22140,7 @@ NsfObject *object; if (GetObjectFromObj(interp, obj, &object) != TCL_OK) { - return NsfPrintError(interp, "Can't destroy object %s that does not exist", + return NsfPrintError(interp, "can't destroy object %s that does not exist", ObjStr(obj)); } Index: generic/nsfError.c =================================================================== diff -u -r86057e0dc49bf59f550ed1b74e11a0e13198d0a8 -r59e100d383b22ea1407f5e5c40e303f2c6bb9027 --- generic/nsfError.c (.../nsfError.c) (revision 86057e0dc49bf59f550ed1b74e11a0e13198d0a8) +++ generic/nsfError.c (.../nsfError.c) (revision 59e100d383b22ea1407f5e5c40e303f2c6bb9027) @@ -262,7 +262,7 @@ Nsf_Object *object, Nsf_Param CONST *paramPtr, Tcl_Obj *procNameObj) { Tcl_DString ds, *dsPtr = &ds; DSTRING_INIT(dsPtr); - Tcl_DStringAppend(dsPtr, "Invalid argument '", -1); + Tcl_DStringAppend(dsPtr, "invalid argument '", -1); Tcl_DStringAppend(dsPtr, argumentString, -1); Tcl_DStringAppend(dsPtr, "', maybe too many arguments;", -1); NsfArgumentError(interp, Tcl_DStringValue(dsPtr), paramPtr, @@ -298,7 +298,7 @@ Nsf_Param CONST *pPtr; DSTRING_INIT(dsPtr); - Tcl_DStringAppend(dsPtr, "Invalid non-positional argument '", -1); + Tcl_DStringAppend(dsPtr, "invalid non-positional argument '", -1); Tcl_DStringAppend(dsPtr, argumentString, -1); Tcl_DStringAppend(dsPtr, "', valid are : ", -1); for (pPtr = currentParamPtr; pPtr->name && *pPtr->name == '-'; pPtr ++) { @@ -337,7 +337,7 @@ NsfDispatchClientDataError(Tcl_Interp *interp, ClientData clientData, CONST char *what, CONST char *methodName) { if (clientData) { - return NsfPrintError(interp, "Method %s not dispatched on valid %s", + return NsfPrintError(interp, "method %s not dispatched on valid %s", methodName, what); } else { return NsfNoCurrentObjectError(interp, methodName); @@ -362,7 +362,7 @@ */ extern int NsfNoCurrentObjectError(Tcl_Interp *interp, CONST char *what) { - return NsfPrintError(interp, "No current object; %s called outside the context of a Next Scripting method", + return NsfPrintError(interp, "no current object; %s called outside the context of a Next Scripting method", what ? what : "command"); } Index: library/xotcl/tests/slottest.xotcl =================================================================== diff -u -r9a0b8bb0992be0561d8187c275fc1d9b7e0bbcd0 -r59e100d383b22ea1407f5e5c40e303f2c6bb9027 --- library/xotcl/tests/slottest.xotcl (.../slottest.xotcl) (revision 9a0b8bb0992be0561d8187c275fc1d9b7e0bbcd0) +++ library/xotcl/tests/slottest.xotcl (.../slottest.xotcl) (revision 59e100d383b22ea1407f5e5c40e303f2c6bb9027) @@ -376,7 +376,7 @@ C instproc init args {set ::_ $args} set ::_ "" - ? {C create c2 -y 1 -x} {Value for parameter '-x' expected} + ? {C create c2 -y 1 -x} {value for parameter '-x' expected} ? {set ::_} "" ? {c2 x} {can't read "x": no such variable} ? {C create c3 -y 1 -x 0} "::c3" Index: library/xotcl/tests/testx.xotcl =================================================================== diff -u -r9a0b8bb0992be0561d8187c275fc1d9b7e0bbcd0 -r59e100d383b22ea1407f5e5c40e303f2c6bb9027 --- library/xotcl/tests/testx.xotcl (.../testx.xotcl) (revision 9a0b8bb0992be0561d8187c275fc1d9b7e0bbcd0) +++ library/xotcl/tests/testx.xotcl (.../testx.xotcl) (revision 59e100d383b22ea1407f5e5c40e303f2c6bb9027) @@ -261,13 +261,13 @@ a set x 1 a check all } - ::errorCheck $err {Assertion failed check: {$x == 1} in proc 'xTo2'} \ + ::errorCheck $err {assertion failed check: {$x == 1} in proc 'xTo2'} \ "inheritance a xTo2" if {![catch {a yTo2} err]} { set err "ok" } - ::errorCheck $err {Assertion failed check: {$y == 1} in proc 'yTo2'} \ + ::errorCheck $err {assertion failed check: {$y == 1} in proc 'yTo2'} \ "inheritance a yTo2" Class B -superclass A @@ -280,13 +280,13 @@ b set x 1 b check all } - ::errorCheck $err {Assertion failed check: {$x == 1} in proc 'xTo2'} \ + ::errorCheck $err {assertion failed check: {$x == 1} in proc 'xTo2'} \ "inheritance b xTo2" if {![catch {b yTo2} err]} { set err "ok" } - ::errorCheck $err {Assertion failed check: {$y == 1} in proc 'yTo2'} \ + ::errorCheck $err {assertion failed check: {$y == 1} in proc 'yTo2'} \ "inheritance b yTo2" a destroy @@ -4028,7 +4028,7 @@ o y 4 56 5 } m errorCheck $m \ - {Invalid argument '5', maybe too many arguments; should be "::o y ?-x value? ?-a value? a b"} \ + {invalid argument '5', maybe too many arguments; should be "::o y ?-x value? ?-a value? a b"} \ "wrong \# check 1" catch { @@ -4115,7 +4115,7 @@ o foo o foo -foo 0 catch {o foo -foo} msg - errorCheck $msg "Value for parameter '-foo' expected" "Empty non-pos arg" + errorCheck $msg "value for parameter '-foo' expected" "Empty non-pos arg" Object oa oa proc foo {{-a A} b} { Index: tests/alias.test =================================================================== diff -u -r7413d266916a491ff674489513351c89987366d7 -r59e100d383b22ea1407f5e5c40e303f2c6bb9027 --- tests/alias.test (.../alias.test) (revision 7413d266916a491ff674489513351c89987366d7) +++ tests/alias.test (.../alias.test) (revision 59e100d383b22ea1407f5e5c40e303f2c6bb9027) @@ -449,10 +449,10 @@ ? {c FOO} {target "::foo" of alias FOO apparently disappeared} ? {C info method definition FOO} "::C public alias FOO ::foo" unset ::nsf::alias(::C,FOO,0) -? {c FOO} {Could not obtain alias definition for ::C FOO.} +? {c FOO} {could not obtain alias definition for ::C FOO.} ? {c FOO2} {target "::foo" of alias FOO2 apparently disappeared} rename ::foo2 ::foo -? {c FOO} {Could not obtain alias definition for ::C FOO.} +? {c FOO} {could not obtain alias definition for ::C FOO.} ? {c FOO2} {::c->FOO2} # Index: tests/contains.test =================================================================== diff -u -r5371aaaf333c92616a8baf6e521df386909b876d -r59e100d383b22ea1407f5e5c40e303f2c6bb9027 --- tests/contains.test (.../contains.test) (revision 5371aaaf333c92616a8baf6e521df386909b876d) +++ tests/contains.test (.../contains.test) (revision 59e100d383b22ea1407f5e5c40e303f2c6bb9027) @@ -89,7 +89,7 @@ C public method foo {{-new 0} name value} { return $value} catch {c1 foo -name a b} errMsg ? {set errMsg} \ - {Invalid argument 'b', maybe too many arguments; should be "::c1 foo ?-new value? name value"} + {invalid argument 'b', maybe too many arguments; should be "::c1 foo ?-new value? name value"} # Test resolving of implicit namespaces in relationcmds (here # superclass) in the nx namespace. Index: tests/destroy.test =================================================================== diff -u -r6d831cc09c3eea83a17baa5ef05dfeb79b05836e -r59e100d383b22ea1407f5e5c40e303f2c6bb9027 --- tests/destroy.test (.../destroy.test) (revision 6d831cc09c3eea83a17baa5ef05dfeb79b05836e) +++ tests/destroy.test (.../destroy.test) (revision 59e100d383b22ea1407f5e5c40e303f2c6bb9027) @@ -886,7 +886,7 @@ ? {$i eval {info exists ::MSG}} 0 $i eval {::nsf::finalize -keepvars} ? {$i eval {info exists ::MSG}} 1 - ? {$i eval {set ::MSG}} [list "Cannot destroy base class ::nx::Object" "Cannot destroy base class ::nx::Class"] + ? {$i eval {set ::MSG}} [list "cannot destroy base class ::nx::Object" "cannot destroy base class ::nx::Class"] interp delete $i unset i Index: tests/disposition.test =================================================================== diff -u -r7413d266916a491ff674489513351c89987366d7 -r59e100d383b22ea1407f5e5c40e303f2c6bb9027 --- tests/disposition.test (.../disposition.test) (revision 7413d266916a491ff674489513351c89987366d7) +++ tests/disposition.test (.../disposition.test) (revision 59e100d383b22ea1407f5e5c40e303f2c6bb9027) @@ -42,7 +42,7 @@ # # Restricted to object parameters only? # - set msg "Parameter option '$paramType' not allowed" + set msg "parameter option '$paramType' not allowed" ? [list C method m1 -foo:$paramType {;}] $msg ? [list C method m1 foo:$paramType {;}] $msg @@ -194,9 +194,9 @@ C setObjectParams {{-single-np:alias}} ? {[C new -single-np [list -x]] eval {set :single-np}} \ - "Value for parameter '-x' expected" + "value for parameter '-x' expected" ? {[C new -single-np [list -x X]] eval {set :single-np}} \ - "Invalid non-positional argument '-x X', valid are : -x; + "invalid non-positional argument '-x X', valid are : -x; should be \"::__%&singleton single-np -x\"" # @@ -275,7 +275,7 @@ array set script {alias "method=baz" forward "method=%self %method"} foreach disposition [list alias forward] { C setObjectParams [list [list -foo:$disposition,switch]] - ? {C new} "Parameter invocation types cannot be used with option 'switch'" \ + ? {C new} "parameter invocation types cannot be used with option 'switch'" \ "switch not allowed for $disposition" C setObjectParams [list [list -baz:$disposition,mytype,$script($disposition)]] @@ -291,33 +291,33 @@ "disposition $disposition, unknown user defined type - just a warning" C setObjectParams [list [list -foo:$disposition,type=::C]] - ? {C new} "Parameter option 'type=' only allowed for parameter types 'object' and 'class'" + ? {C new} "parameter option 'type=' only allowed for parameter types 'object' and 'class'" # # The 'arg=...' option should not be used, consider using 'method=...' # C setObjectParams [list [list -foo:$disposition,arg=BOOM]] - ? {C new} "Parameter option 'arg=' only allowed for user-defined converter" + ? {C new} "parameter option 'arg=' only allowed for user-defined converter" } # # The option 'method=...' applies to disposition types only # C setObjectParams [list [list -foo:initcmd,method=BOOM]] - ? {C new} "Parameter option 'method=' only allowed for parameter types 'alias' and 'forward'" + ? {C new} "parameter option 'method=' only allowed for parameter types 'alias' and 'forward'" C setObjectParams [list [list -foo:alias,forward]] - ? {C new} "Parameter types 'alias' and 'forward' cannot be used together" + ? {C new} "parameter types 'alias' and 'forward' cannot be used together" C setObjectParams [list [list -foo:forward,alias]] - ? {C new} "Parameter types 'alias' and 'forward' cannot be used together" + ? {C new} "parameter types 'alias' and 'forward' cannot be used together" C setObjectParams [list [list -foo:alias,initcmd]] - ? {C new} "Parameter types 'alias' and 'initcmd' cannot be used together" + ? {C new} "parameter types 'alias' and 'initcmd' cannot be used together" C setObjectParams [list [list -foo:forward,initcmd]] - ? {C new} "Parameter types 'forward' and 'initcmd' cannot be used together" + ? {C new} "parameter types 'forward' and 'initcmd' cannot be used together" } nx::Test case dispo-multiplicities { @@ -849,21 +849,21 @@ # don't allow other types for parameter option "args" # C setObjectParams {{args:alias,int,method=Residualargs,args {hello world}}} - ? {C create c1} {Refuse to redefine parameter type of 'args' from type 'integer' to type 'args'} + ? {C create c1} {refuse to redefine parameter type of 'args' from type 'integer' to type 'args'} ? {c1 eval {info exists :args}} 0 C setObjectParams {{args:int,alias,method=Residualargs,args {hello world}}} - ? {C create c1} {Refuse to redefine parameter type of 'args' from type 'integer' to type 'args'} + ? {C create c1} {refuse to redefine parameter type of 'args' from type 'integer' to type 'args'} ? {c1 eval {info exists :args}} 0 # # don't allow multiplicity settings for parameter option "args" # C setObjectParams {{args:alias,method=Residualargs,0..n,args {hello world}}} - ? {C create c1} {Multiplicity settings for variable argument parameter "args" not allowed} + ? {C create c1} {multiplicity settings for variable argument parameter "args" not allowed} ? {c1 eval {info exists :args}} 0 C setObjectParams {args:alias,method=Residualargs,args,1..n} - ? {C create c1} {Multiplicity settings for variable argument parameter "args" not allowed} + ? {C create c1} {multiplicity settings for variable argument parameter "args" not allowed} ? {c1 eval {info exists :args}} 0 # @@ -1293,7 +1293,7 @@ # ISSUE: positional objparam + alias + noarg -> what's the point? # noarg & ?z? are irritating, ?z? should not be printed! # - ? {T create t XXX} "Invalid argument 'XXX', maybe too many arguments; should be \"::t configure ?z?\"" + ? {T create t XXX} "invalid argument 'XXX', maybe too many arguments; should be \"::t configure ?z?\"" ::obj mixin {} T setObjectParams [list z:alias] Index: tests/info-method.test =================================================================== diff -u -r6d831cc09c3eea83a17baa5ef05dfeb79b05836e -r59e100d383b22ea1407f5e5c40e303f2c6bb9027 --- tests/info-method.test (.../info-method.test) (revision 6d831cc09c3eea83a17baa5ef05dfeb79b05836e) +++ tests/info-method.test (.../info-method.test) (revision 59e100d383b22ea1407f5e5c40e303f2c6bb9027) @@ -1211,5 +1211,5 @@ # Test error messages within an ensemble call # nx::Test case error-in-ensemble { - ? {nx::Object info method definition foo 1} {Invalid argument '1', maybe too many arguments; should be "::nx::Object info method args|body|definition|exists|registrationhandle|definitionhandle|handle|origin|parameter|parametersyntax|type|precondition|postcondition|submethods|returns name"} + ? {nx::Object info method definition foo 1} {invalid argument '1', maybe too many arguments; should be "::nx::Object info method args|body|definition|exists|registrationhandle|definitionhandle|handle|origin|parameter|parametersyntax|type|precondition|postcondition|submethods|returns name"} } \ No newline at end of file Index: tests/method-parameter.test =================================================================== diff -u -rd62bca12731d1c7a1a5cf63f950275852c5b05a2 -r59e100d383b22ea1407f5e5c40e303f2c6bb9027 --- tests/method-parameter.test (.../method-parameter.test) (revision d62bca12731d1c7a1a5cf63f950275852c5b05a2) +++ tests/method-parameter.test (.../method-parameter.test) (revision 59e100d383b22ea1407f5e5c40e303f2c6bb9027) @@ -11,18 +11,18 @@ ? {p0 -x} {wrong # args: should be "p0"} ? {p1} 0 - ? {p1 -x} {Value for parameter '-x' expected} + ? {p1 -x} {value for parameter '-x' expected} ? {p1 -x 1} 1 - ? {p1 -x 1 2} {Invalid argument '2', maybe too many arguments; should be "p1 ?-x value?"} - ? {p1 -x 1 -y} {Invalid non-positional argument '-y', valid are : -x; + ? {p1 -x 1 2} {invalid argument '2', maybe too many arguments; should be "p1 ?-x value?"} + ? {p1 -x 1 -y} {invalid non-positional argument '-y', valid are : -x; should be "p1 ?-x value?"} - ? {p1 a} {Invalid argument 'a', maybe too many arguments; should be "p1 ?-x value?"} - ? {p1 a -x} {Invalid argument 'a', maybe too many arguments; should be "p1 ?-x value?"} + ? {p1 a} {invalid argument 'a', maybe too many arguments; should be "p1 ?-x value?"} + ? {p1 a -x} {invalid argument 'a', maybe too many arguments; should be "p1 ?-x value?"} ? {p1 --} 0 - ? {p1 -y} {Invalid non-positional argument '-y', valid are : -x; + ? {p1 -y} {invalid non-positional argument '-y', valid are : -x; should be "p1 ?-x value?"} - ? {p1 -y --} {Invalid non-positional argument '-y', valid are : -x; + ? {p1 -y --} {invalid non-positional argument '-y', valid are : -x; should be "p1 ?-x value?"} # @@ -49,15 +49,15 @@ ? {p2c -x -y} {1 {}} ;# "-y" is the value of "x"; TODO: noleadindash currently only for posargs ? {p2a -x 1 -y} {1 -y} - ? {p2b -x 1 -y} {Invalid non-positional argument '-y', valid are : -x; + ? {p2b -x 1 -y} {invalid non-positional argument '-y', valid are : -x; should be "p2b ?-x value? ?arg ...?"} - ? {p2c -x 1 -y} {Invalid non-positional argument '-y', valid are : -x; + ? {p2c -x 1 -y} {invalid non-positional argument '-y', valid are : -x; should be "p2c ?-x value? ?arg ...?"} nsf::proc p3a {a -x -y b:noleadingdash -z} {return [list $a [info exists x] [info exists y] $b]} ? {p3a 100 -x 1 -y 1 200} {100 1 1 200} - ? {p3a 100 -xx 1 -y 1 200} {Invalid non-positional argument '-xx', valid are : -x, -y; + ? {p3a 100 -xx 1 -y 1 200} {invalid non-positional argument '-xx', valid are : -x, -y; should be "p3a a ?-x value? ?-y value? b ?-z value?"} } @@ -67,15 +67,15 @@ :public method p1 {-x} {return [list [info exists x]]} :create c1 } - ? {c1 p1 -x 1 -y} {Invalid non-positional argument '-y', valid are : -x; + ? {c1 p1 -x 1 -y} {invalid non-positional argument '-y', valid are : -x; should be "::c1 p1 ?-x value?"} proc ::nsf::argument::unknown {method arg args} { puts stderr "??? unknown nonpos-arg $arg in $method obj <$args>\n[info frame -1]\n" return "" } - ? {c1 p1 -x 1 -y} {Invalid non-positional argument '-y', valid are : -x; + ? {c1 p1 -x 1 -y} {invalid non-positional argument '-y', valid are : -x; should be "::c1 p1 ?-x value?"} if {0} { @@ -86,7 +86,7 @@ return "" } - ? {c1 p1 -x 1 -y} {Invalid non-positional argument '-y', valid are : -x; + ? {c1 p1 -x 1 -y} {invalid non-positional argument '-y', valid are : -x; should be "::c1 p1 ?-x value?"} } } Index: tests/method-require.test =================================================================== diff -u -rc4997e0189bb712287aa53d12bb3e332acfb781d -r59e100d383b22ea1407f5e5c40e303f2c6bb9027 --- tests/method-require.test (.../method-require.test) (revision c4997e0189bb712287aa53d12bb3e332acfb781d) +++ tests/method-require.test (.../method-require.test) (revision 59e100d383b22ea1407f5e5c40e303f2c6bb9027) @@ -126,5 +126,5 @@ nx::Object create o ::nsf::method::require o alloc - ? {o alloc x} {Method alloc not dispatched on valid class} + ? {o alloc x} {method alloc not dispatched on valid class} } Index: tests/methods.test =================================================================== diff -u -r7413d266916a491ff674489513351c89987366d7 -r59e100d383b22ea1407f5e5c40e303f2c6bb9027 --- tests/methods.test (.../methods.test) (revision 7413d266916a491ff674489513351c89987366d7) +++ tests/methods.test (.../methods.test) (revision 59e100d383b22ea1407f5e5c40e303f2c6bb9027) @@ -421,15 +421,15 @@ } # dispatch methods without current object - ? ::o::a "Method ::o::a not dispatched on valid object" + ? ::o::a "method ::o::a not dispatched on valid object" ? ::o::b "::o2" - ? ::o::foo "No current object; command called outside the context of a Next Scripting method" - ? ::o::x "No current object; x called outside the context of a Next Scripting method" + ? ::o::foo "no current object; command called outside the context of a Next Scripting method" + ? ::o::x "no current object; x called outside the context of a Next Scripting method" # make a regular call, provide tcd->object with a value ? {::o x} "::o" # check, if missing object is still detected - ? ::o::x "No current object; x called outside the context of a Next Scripting method" - ? nx::self "No current object; command called outside the context of a Next Scripting method" + ? ::o::x "no current object; x called outside the context of a Next Scripting method" + ? nx::self "no current object; command called outside the context of a Next Scripting method" } Index: tests/parameters.test =================================================================== diff -u -r618e2ee5017eb139591870f9f521b971bb16bbc2 -r59e100d383b22ea1407f5e5c40e303f2c6bb9027 --- tests/parameters.test (.../parameters.test) (revision 618e2ee5017eb139591870f9f521b971bb16bbc2) +++ tests/parameters.test (.../parameters.test) (revision 59e100d383b22ea1407f5e5c40e303f2c6bb9027) @@ -24,9 +24,9 @@ ? {::nsf::method::alias C foo ::set} "::nsf::classes::C::foo" ? {::nsf::method::alias C foo ::set 1} \ - {Invalid argument '1', maybe too many arguments; should be "::nsf::method::alias object ?-per-object? methodName ?-frame method|object|default? cmdName"} + {invalid argument '1', maybe too many arguments; should be "::nsf::method::alias object ?-per-object? methodName ?-frame method|object|default? cmdName"} - ? {C eval {:property x -class D}} {Invalid argument 'D', maybe too many arguments; should be "::C property ?-class value? spec ?initblock?"} "Test whether the colon prefix is suppressed" + ? {C eval {:property x -class D}} {invalid argument 'D', maybe too many arguments; should be "::C property ?-class value? spec ?initblock?"} "Test whether the colon prefix is suppressed" } ####################################################### @@ -640,7 +640,7 @@ # create a userdefined type ::nx::methodParameterSlot method type=mytype {name value} { if {$value < 1 || $value > 3} { - error "Value '$value' of parameter $name is not between 1 and 3" + error "value '$value' of parameter $name is not between 1 and 3" } } @@ -650,7 +650,7 @@ d1 foo 1 ? {d1 foo 10} \ - "Value '10' of parameter a is not between 1 and 3" \ + "value '10' of parameter a is not between 1 and 3" \ "value not between 1 and 3" D public method foo {a:unknowntype} { @@ -664,7 +664,7 @@ # create a userdefined type with a simple argument ::nx::methodParameterSlot method type=in {name value arg} { if {$value ni [split $arg |]} { - error "Value '$value' of parameter $name not in permissible values $arg" + error "value '$value' of parameter $name not in permissible values $arg" } return $value } @@ -675,7 +675,7 @@ ? {d1 foo a} "a=a" ? {d1 foo 10} \ - "Value '10' of parameter a not in permissible values a|b|c" \ + "value '10' of parameter a not in permissible values a|b|c" \ "invalid value" D public method foo {a:in,arg=a|b|c b:in,arg=good|bad {-c:in,arg=a|b a}} { @@ -685,13 +685,13 @@ ? {d1 foo a good -c b} "a=a,b=good,c=b" ? {d1 foo a good} "a=a,b=good,c=a" ? {d1 foo b "very good"} \ - "Value 'very good' of parameter b not in permissible values good|bad" \ + "value 'very good' of parameter b not in permissible values good|bad" \ "invalid value (not included)" ::nx::methodParameterSlot method type=range {name value arg} { foreach {min max} [split $arg -] break if {$value < $min || $value > $max} { - error "Value '$value' of parameter $name not between $min and $max" + error "value '$value' of parameter $name not between $min and $max" } return $value } @@ -703,12 +703,12 @@ ? {d1 foo 2 -b 4 9} "a=2,b=4,c=9" ? {d1 foo 2 10} "a=2,b=3,c=10" ? {d1 foo 2 11} \ - "Value '11' of parameter c not between 5 and 10" \ + "value '11' of parameter c not between 5 and 10" \ "invalid value" # define type twice ? {D public method foo {a:int,range,arg=1-3} {return a=$a}} \ - "Parameter option 'range' unknown for parameter type 'integer'" \ + "parameter option 'range' unknown for parameter type 'integer'" \ "invalid value" # # handling of arg with spaces/arg as list @@ -1489,7 +1489,7 @@ } set ::_ "" - ? {C create c2 -y 1 -x} {Value for parameter '-x' expected} + ? {C create c2 -y 1 -x} {value for parameter '-x' expected} ? {set ::_} "" ? {c2 x} {can't read "x": no such variable} ? {C create c3 -y 1 -x 0} "::c3" @@ -1904,14 +1904,14 @@ ::nx::ObjectParameterSlot method type=range {name value arg} { lassign [split $arg -] min max if {$value < $min || $value > $max} { - error "Value '$value' of parameter $name not between $min and $max" + error "value '$value' of parameter $name not between $min and $max" } return $value } ::nx::ObjectParameterSlot method type=range {name value arg} { lassign [split $arg -] min max if {$value < $min || $value > $max} { - error "Value '$value' of parameter $name not between $min and $max" + error "value '$value' of parameter $name not between $min and $max" } return $value } @@ -1920,9 +1920,9 @@ # Test usage of application specific converter in "variable" and # "property"; invalid value ? [list [self] variable -nocomplain r1:range,arg=1-10 11] \ - {Value '11' of parameter value not between 1 and 10} + {value '11' of parameter value not between 1 and 10} ? [list [self] property -nocomplain [list r2:range,arg=1-10 11]] \ - {Value '11' of parameter value not between 1 and 10} + {value '11' of parameter value not between 1 and 10} # valid value ? [list [self] variable -nocomplain r1:range,arg=1-10 5] "" @@ -1995,7 +1995,7 @@ ? {C create c2 -a 10} ::c2 ? {C create c2 -v 10} \ - {Invalid non-positional argument '-v', valid are : -a, -volatile, -properties, -noinit, -mixin, -class, -filter; + {invalid non-positional argument '-v', valid are : -a, -volatile, -properties, -noinit, -mixin, -class, -filter; should be "::c2 configure ?-a value? ?-volatile? ?-properties value? ?-noinit? ?-mixin mixinreg ...? ?-class class? ?-filter filterreg ...? ?__initcmd?"} # Index: tests/protected.test =================================================================== diff -u -rc4997e0189bb712287aa53d12bb3e332acfb781d -r59e100d383b22ea1407f5e5c40e303f2c6bb9027 --- tests/protected.test (.../protected.test) (revision c4997e0189bb712287aa53d12bb3e332acfb781d) +++ tests/protected.test (.../protected.test) (revision 59e100d383b22ea1407f5e5c40e303f2c6bb9027) @@ -114,39 +114,39 @@ ? {::nsf::method::property C foo redefine-protected true} 1 ? {C method SET {a b c} {...}} \ - {Method 'SET' of ::C cannot be overwritten. Derive e.g. a sub-class!} \ + {method 'SET' of ::C cannot be overwritten; derive e.g. a sub-class!} \ "redefine method SET" ? {C method foo {a b c} {...}} \ - {Method 'foo' of ::C cannot be overwritten. Derive e.g. a sub-class!} \ + {method 'foo' of ::C cannot be overwritten; derive e.g. a sub-class!} \ "redefine method foo" # check a predefined protection ? {::nx::Class method create {a b c} {...}} \ - {Method 'create' of ::nx::Class cannot be overwritten. Derive e.g. a sub-class!} \ + {method 'create' of ::nx::Class cannot be overwritten; derive e.g. a sub-class!} \ "redefine method create" # try to redefine predefined protected method via alias ? {::nsf::method::alias nx::Class create ::set} \ - {Method 'create' of ::nx::Class cannot be overwritten. Derive e.g. a sub-class!} \ + {method 'create' of ::nx::Class cannot be overwritten; derive e.g. a sub-class!} \ "redefine alias create" # try to redefine via forward ? {C forward SET ::set} \ - {Method 'SET' of ::C cannot be overwritten. Derive e.g. a sub-class!} \ + {method 'SET' of ::C cannot be overwritten; derive e.g. a sub-class!} \ "redefine forward SET" # try to redefine via setter ? {C property SET} \ - {Method 'SET' of ::C cannot be overwritten. Derive e.g. a sub-class!} \ + {method 'SET' of ::C cannot be overwritten; derive e.g. a sub-class!} \ "redefine property SET" # redefine-protect object specific method nx::Object create o o method foo {} {return 13} ::nsf::method::property o foo redefine-protected true ? {o method foo {} {return 14}} \ - {Method 'foo' of ::o cannot be overwritten. Derive e.g. a sub-class!} + {method 'foo' of ::o cannot be overwritten; derive e.g. a sub-class!} }