I may have missed the point here, but would it be sufficient to have
two flavours of diagnostic calls, distinguishing between pre-test
diagnostics (`forewarn()`) and post-test diagnostics (`reflect()`), or
is the problem that ok() must be a single function call?

If that's possible, maybe we can extend it to guess at what the
various messages mean: most diags can be assumed to be of the
`reflect()` type, as that's typical behaviour, e.g. Test::More, while
more perlish warnings is most likely to be of the `forewarn()`
variety.

Daniel

On 10 July 2012 19:11, Michael G Schwern <schw...@pobox.com> wrote:
> On 2012.6.1 5:40 AM, Steffen Schwigon wrote:
>> I am about to upload Test::TAPv13. I also did an prepan entry for that.
>>
>> PrePAN:   http://prepan.org/module/429En4oFbn .
>> URL:      https://github.com/renormalist/Test-TAPv13
>> Synopsis:
>>
>>    use Test::TAPv13 ':all'; # must come before Test::More
>>    use Test::More tests => 2;
>>
>>    my $data = { affe => { tiger => 111,
>>                           birne => "amazing",
>>                           loewe => [ qw( 1 two three) ],
>>                         },
>>                 zomtec => "here's another one",
>>                 "DrWho" => undef,
>>               };
>>
>>    ok(1, "hot stuff");
>>    tap13_yaml($data);
>>    tap13_pragma "+strict";
>>    ok(1, "more hot stuff");
>>
>> Does it make sense?
>> Did I overlook an existing way to generate TAP v13?
>
> I'm just seeing this now.  The output looks correct and I'm happy to see
> somebody playing with the structured diagnostics for reals!  There's a few
> code nits, but I'll note them on github.
>
> Test::Builder1.5 can generate TAP v13, in fact it does so by default, but is
> currently lacking the structured diagnostics part.  Part of this is just
> time/effort, but the larger part is with how tests are written...
>
> The problem with...
>
>     ok( ... );
>     diagnostics( ... );
>
> Is that there's no reliable way to know that diagnostics() goes with the
> previous ok().  This is ok for TAP, where the test result and diagnostics are
> on separate lines and can be printed separately, but other formats need to
> print out the results and diagnostics together.  Like anything where the
> diagnostics information is inside a <result> tag, for example.
>
> That pattern has to be rethought.  This was one of the goals of Test::Builder2
> (the new class to replace Test::Builder) but that is on hold.  Any thoughts?
>
> Also, when did we add the pragma thing?
>
>
> --
> The interface should be as clean as newly fallen snow and its behavior
> as explicit as Japanese eel porn.

Reply via email to