Compare commits

...
Author SHA1 Message Date
jan.nijtmans 5d9667fbd5 (experiment): Always compile ensembles. Result: 2 test failures in the "history" ensemble:
==== history-1.5 event option FAILED
==== Contents of test case:
history e "* a*"
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
---- errorInfo: unknown subcommand "e": must be add, change, clear, event, info, keep, nextid, or redo
    while executing
"history e {* a*}"
    invoked from within
"history e "* a*""
    ("uplevel" body line 1)
    invoked from within
"uplevel 1 $script"
---- errorCode: TCL LOOKUP SUBCOMMAND e
==== history-1.5 FAILED



==== history-4.1 change option FAILED
==== Contents of test case:
history event [expr {[history n]-1}]
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
---- errorInfo: unknown subcommand "n": must be add, change, clear, event, info, keep, nextid, or redo
    while executing
"history n"
    invoked from within
"history n"
    ("uplevel" body line 1)
    invoked from within
"uplevel 1 $script"
---- errorCode: TCL LOOKUP SUBCOMMAND n
==== history-4.1 FAILED

Test file error: unknown subcommand "ch": must be add, change, clear, event, info, keep, nextid, or redo
    while executing
"history ch {Another test} -1"
    invoked from within
"history ch "Another test" -1"
    invoked from within
"if {[testConstraint history]} {
    history ch "Another test" -1
}"
    (file "tests/history.test" line 117)
2017-06-01 13:11:42 +00:00
2 changed files with 5 additions and 13 deletions
+4 -12
View File
@@ -55,12 +55,11 @@ enum EnsSubcmds {
};
static const char *const ensembleCreateOptions[] = {
"-command", "-compile", "-map", "-parameters", "-prefixes",
"-subcommands", "-unknown", NULL
"-command", "-map", "-parameters", "-prefixes", "-subcommands",
"-unknown", NULL
};
enum EnsCreateOpts {
CRT_CMD, CRT_COMPILE, CRT_MAP, CRT_PARAM, CRT_PREFIX,
CRT_SUBCMDS, CRT_UNKNOWN
CRT_CMD, CRT_MAP, CRT_PARAM, CRT_PREFIX, CRT_SUBCMDS, CRT_UNKNOWN
};
static const char *const ensembleConfigOptions[] = {
@@ -184,7 +183,6 @@ TclNamespaceEnsembleCmd(
int permitPrefix = 1;
Tcl_Obj *unknownObj = NULL;
Tcl_Obj *paramObj = NULL;
int ensCompFlag = -1;
/*
* Check that we've got option-value pairs... [Bug 1558654]
@@ -327,12 +325,6 @@ TclNamespaceEnsembleCmd(
return TCL_ERROR;
}
continue;
case CRT_COMPILE:
if (Tcl_GetBooleanFromObj(interp, objv[1],
&ensCompFlag) != TCL_OK) {
return TCL_ERROR;
};
continue;
case CRT_UNKNOWN:
if (TclListObjLength(interp, objv[1], &len) != TCL_OK) {
if (allocatedMapFlag) {
@@ -361,7 +353,7 @@ TclNamespaceEnsembleCmd(
/*
* Ensemble should be compiled if it has map (performance purposes)
*/
if (ensCompFlag > 0 && mapObj != NULL) {
if (mapObj != NULL) {
Tcl_SetEnsembleFlags(interp, token, ENSEMBLE_COMPILE);
}
+1 -1
View File
@@ -186,7 +186,7 @@ if {[interp issafe]} {
}
namespace inscope ::tcl::clock [list namespace ensemble create -command \
[uplevel 1 [list ::namespace origin [::lindex [info level 0] 0]]] \
-map $cmdmap -compile 1]
-map $cmdmap]
uplevel 1 [info level 0]
}