On 9/29/06, Ovid <[EMAIL PROTECTED]> wrote:
    got:      this is line 1
              this is line 2
              this is line 3
    expected: this is line 1
              this is line b
              this is line 3

i prefer this syntax, as it's easier to parse in languages without
builtin heredocs. however, it bothers me that with this syntax it's
difficult to tell if and how many leading spaces the first line of got
or expected output contains. may i propose instead that '     got:', '
   expected:', etc. appear on their own line, and a fixed number of
spaces precede the output. that makes it easy to parse both visually
and programmaticly.

    got:
           this is line 1
          this is line 2
         this is line 3

in this example, there are five spaces before 'got:', and ten before
the output. additionally, each line of output contains two spaces
(some before, and some after.) it's not easy to visually parse
differences in trailing spaces, but i'm not sure it's worth addressing
that problem, as any fix is likely to be quite ugly, and unnecessary
in the majority of cases.

~jerry

Reply via email to