--- "Philippe Bruhat (BooK)" <[EMAIL PROTECTED]> wrote:

> The biggest trouble I had was for diagnostics. I ended up considering
> that diagnostics output after a test result belong to the test result
> (as a comment to it), and that diagnostics appearing before the first
> test result are "global" to the whole test script. Which means that
> "#
> Looks like you failed 3 tests of 22." is always attached to the last
> test.

What were you trying to do with the diagnostics?  Simply store them, or
something more elaborate?  Right now, Test::More::Diagnostic can
somewhat help:

  use Test::Most;
  use Test::More::Diagnostic;
  plan tests => 3;

  is 3, 3, 'passes';
  is 3, 4, 'fails';
  eq_or_diff [qw/this that/], [qw/this other/], 'fails structure';

That generates something like this:

  TAP version 13
  1..3
  ok 1 - passes
  not ok 2 - fails
    ---
    file: t/fail.t
    line: 11
    ...
  not ok 3 - fails structure
    ---
    file: t/fail.t
    line: 12
    ...

  #   Failed test 'fails'
  #   at t/fail.t line 11.
  #          got: '3'
  #     expected: '4'

  #   Failed test 'fails structure'
  #   at t/fail.t line 12.
  # +----+------+----------+
  # | Elt|Got   |Expected  |
  # +----+------+----------+
  # |   0|this  |this      |
  # *   1|that  |other     *
  # +----+------+----------+
  # Looks like you failed 2 tests of 3.

So you don't get the "old" diagnostics after the test (this was never
guaranteed anyway), but you get the new-style YAML diagnostics. 
Unfortunately, the "got/expected"  information is still somewhat lost
and I suspect that's what you're really looking for.

This is, in my opinion, the single most important thing that we need to
resolve in Perl's testing world:  moving people to TAP version 13 along
with full diagnostics in TAP that software can actually read.

Cheers,
Ovid

--
Buy the book  - http://www.oreilly.com/catalog/perlhks/
Perl and CGI  - http://users.easystreet.com/ovid/cgi_course/
Personal blog - http://publius-ovidius.livejournal.com/
Tech blog     - http://use.perl.org/~Ovid/journal/

Reply via email to