diff options
| author | dgp <dgp@users.sourceforge.net> | 2016-10-20 17:54:47 (GMT) |
|---|---|---|
| committer | dgp <dgp@users.sourceforge.net> | 2016-10-20 17:54:47 (GMT) |
| commit | bfae5bf49268737c01fe601a9c556ca7af4f8973 (patch) | |
| tree | 3336429c96e95d49f535386b99a64a05701fa7d9 | |
| parent | 8b894ab295af35f4793ab68580a0f2cb6477a638 (diff) | |
| download | tcl-bfae5bf49268737c01fe601a9c556ca7af4f8973.zip tcl-bfae5bf49268737c01fe601a9c556ca7af4f8973.tar.gz tcl-bfae5bf49268737c01fe601a9c556ca7af4f8973.tar.bz2 | |
EVIL HACKs are bad. Unnecessary ones are intolerable. Bad tests cause trouble.
| -rw-r--r-- | generic/tclCompCmds.c | 11 | ||||
| -rw-r--r-- | tests/format.test | 7 |
2 files changed, 5 insertions, 13 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 3ab03cc..7dba232 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -3206,17 +3206,6 @@ TclCompileFormatCmd( */ TclEmitInstInt1(INST_STR_CONCAT1, i, envPtr); - } else { - /* - * EVIL HACK! Force there to be a string representation in the case - * where there's just a "%s" in the format; case covered by the test - * format-20.1 (and it is horrible...) - */ - - TclEmitOpcode(INST_DUP, envPtr); - PushStringLiteral(envPtr, ""); - TclEmitOpcode(INST_STR_EQ, envPtr); - TclEmitOpcode(INST_POP, envPtr); } return TCL_OK; } diff --git a/tests/format.test b/tests/format.test index 27eac31..e199398 100644 --- a/tests/format.test +++ b/tests/format.test @@ -564,9 +564,12 @@ test format-19.3 {Bug 2830354} { test format-20.1 {Bug 2932421: plain %s caused intrep change of args} -body { set x [dict create a b c d] format %s $x - # After this, obj in $x should be a dict with a non-NULL bytes field + # After this, obj in $x should be a dict + # We are testing to make sure it has not been shimmered to a + # different intrep when that is not necessary. + # Whether or not there is a string rep - we should not care! tcl::unsupported::representation $x -} -match glob -result {value is a dict with *, string representation "*"} +} -match glob -result {value is a dict *} # cleanup catch {unset a} |
