Skip to content
Tcl Source Code History Of Ticket 3377401
Login

History Of Ticket 3377401

Artifacts Associated With Ticket 3377401

  1. Ticket change [657130901f] (rid 102549) by kryali on 2011-07-25 18:22:25:

    1. assignee initialized to: "dgp"
    2. cmimetype initialized to: "text/plain"
    3. 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
      
      
    4. foundin initialized to: "obsolete: 8.5.10"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "kryali"
    10. subsystem initialized to: "34. tcltest Package"
    11. title initialized to: "Tcltest -output ignores newlines"
    12. type initialized to: "Bug"
  2. Ticket change [2c8b01d3c5] (rid 118921) by kryali on 2011-07-26 01:53:22:

    1. 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
      }
      
      
    2. login: "kryali"
    3. mimetype: "text/plain"
    4. username: "kryali"
  3. Ticket change [9fb8ec21ec] (rid 96689) by ferrieux on 2011-07-26 02:42:35:

    1. 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)]
      }
          }
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  4. Ticket change [e3f0b9f956] (rid 87878) by ferrieux on 2011-07-26 02:53:18:

    1. 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: }
      
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  5. Ticket change [f76be152ce] (rid 91377) by ferrieux on 2011-07-26 03:05:53:

    1. 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.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  6. Ticket change [bbd5317be7] (rid 129556) by ferrieux on 2011-07-27 00:50:56:

    1. closedate changed to: "2011-07-26T17:50:56"
    2. closer changed to: "ferrieux"
    3. 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.
      
      
      
    4. login: "ferrieux"
    5. mimetype: "text/plain"
    6. resolution changed to: "Wont Fix"
    7. status changed to: "Closed"
    8. username: "ferrieux"