space lost from -output option of test
Closed / Wont Fix612804ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2002-09-22 12:18:15
I am using
-output "\n<HTML>xxx</HTML>\n"
as an option for [test], but internally the newlines
are trimmed and the
actually generated output is compared with
"<HTML>xxx</HTML>".
The problem seems to arise around line 1802 of tcltest.tcl:
# The old test format can't have a 3rd argument
(constraints or
# script) that starts with '-'.
if {[string match -* [lindex $args 0]]
|| ([llength $args] <= 1)} {
if {[llength $args] == 1} {
set list [SubstArguments [lindex $args 0]]
foreach {element value} $list {
set testAttributes($element) $value
}
foreach item {constraints match setup body cleanup \
result returnCodes output errorOutput} {
if {[info exists testAttributes(-$item)]} {
set testAttributes(-$item) [uplevel 1 \
::concat $testAttributes(-$item)]
############## The whitespace is lost here.
}
}
dgpplain2002-09-23 01:26:22
Logged In: YES user_id=80530 Can you provide a complete [test] command that demonstrates the problem? It appears you may be using the 3 argument form of [test]. Don't do that. That form lacks documentation of its substitution rules, so I can't fix "bugs" in it, because it's impossible to distinguish a bug from intended (if bizarre) behavior. If -output does not work in the normal form of [test], please followup.
pifpafpufplain2002-09-24 02:26:39
Logged In: YES user_id=367359 I did not know that the 3 arg version is frowned upon. I agree on the "bizarre behaviour". It is in fact the reason why I did not dare to do create a patch. Harald.
dgpplain2002-09-24 02:29:57
Logged In: YES user_id=80530 You mean the comments in the documentation were not harsh enough? :-)
dgp Closed ticket [612804ffff].
[History diff]2002-09-24 02:30:28
Log in (anonymous is fine) to add a comment.