Artifacts Associated With Ticket 3377401
Ticket change [657130901f] (rid 102549) by kryali on 2011-07-25 18:22:25:
- assignee initialized to: "dgp"
- cmimetype initialized to: "text/plain"
- comment initialized to:
In a simple tcltest monitoring stdout, -output ignores any newlines passed to it. Reproducible: http://pastebin.com/JxG9Czpr Possible reasons: (via irc) <ferrieux> there seems to be an implicit [string trimright] on the -output arg <ferrieux> should not be there
- foundin initialized to: "obsolete: 8.5.10"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "kryali"
- subsystem initialized to: "34. tcltest Package"
- title initialized to: "Tcltest -output ignores newlines"
- type initialized to: "Bug"
Ticket change [2c8b01d3c5] (rid 118921) by kryali on 2011-07-26 01:53:22:
- icomment:
Ah, after following some advice, I modified the construction of the test to work. As below: package require tcltest 2.0 namespace import ::tcltest::* test new-1 { match newline outputs } -setup { } -body { puts "Hello World" } -output {Hello World } - login: "kryali"
- mimetype: "text/plain"
- username: "kryali"
- icomment:
Ticket change [9fb8ec21ec] (rid 96689) by ferrieux on 2011-07-26 02:42:35:
- icomment:
The culprit is the following list-normalizing [concat] in tcltest.tcl. Motive unclear. foreach item {constraints match setup body cleanup \ result returnCodes output errorOutput} { if {[info exists testAttributes(-$item)]} { set testAttributes(-$item) [uplevel 1 \ ::concat $testAttributes(-$item)] } } - login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [e3f0b9f956] (rid 87878) by ferrieux on 2011-07-26 02:53:18:
- icomment:
Fossil annotate traces back to: 30eb4d542e 2000-10-24 jenn: if {[info exists testAttributes([subst -$item])]} { 30eb4d542e 2000-10-24 jenn: set testAttributes([subst -$item]) \ 30eb4d542e 2000-10-24 jenn: [uplevel concat $testAttributes([subst -$item])] 30eb4d542e 2000-10-24 jenn: } - login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [f76be152ce] (rid 91377) by ferrieux on 2011-07-26 03:05:53:
- icomment:
Turns out that code path is strictly reserved to the options-in-one-block syntax. So the workaround you've found is simply the Right Thing To Do. I'd love to know the rationale for the old semantics though.
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [bbd5317be7] (rid 129556) by ferrieux on 2011-07-27 00:50:56:
- closedate changed to: "2011-07-26T17:50:56"
- closer changed to: "ferrieux"
- icomment:
The half-rationale or more accurately the apologies, are provided in the tcltest.n manpage: So the space-collapsing is one of the many side-effects of that unfortunate, now deprecated, but documented, single-block syntax. Hence closing as Won't Fix for lack of a Don't Do That. test name description optionList This form of test was provided to enable passing many options spanning several lines to test as a single argument quoted by braces, rather than needing to backslash quote the newlines between arguments to test. The optionList argument is expected to be a list with an even number of elements representing option and value arguments to pass to test. However, these values are not passed directly, as in the alternate forms of switch. Instead, this form makes an unfortunate attempt to overthrow Tcl’s substitution rules by performing substitutions on some of the list elements as an attempt to implement a “do what I mean” interpretation of a brace-enclosed “block”. The result is nearly impossible to document clearly, and for that reason this form is not recommended. - login: "ferrieux"
- mimetype: "text/plain"
- resolution changed to: "Wont Fix"
- status changed to: "Closed"
- username: "ferrieux"