[Pdx-pm] Test::Builder calling convention

benh ben.hengst at gmail.com
Tue Mar 17 18:38:13 PDT 2009


On Tue, Mar 17, 2009 at 5:20 PM, Michael G Schwern <schwern at pobox.com> wrote:
> benh wrote:
>> If we decupple the display then we can essentually template out any
>> given data to be TAP. That said what would you want this to look like
>> as data?
>>
>> my $data = {
>>  tests => [
>>   { pass => 0, have => 'foo', want => 'bar', file => 't/foo.t', line => 23 },
>>   { pass => 0, msg => 'Failed test in t/foo.t at line 23.' }
>>  ],
>>  msg => 'I like pie',
>> };
>
> That loses order.  It would have to be more like this:
>
>  my @data = [
>      { pass => 0, have => 'foo', want => 'bar', file => 't/foo.t', line => 23 },
>      { pass => 0, msg => 'Failed test in t/foo.t at line 23.' },
>      { msg => 'I like pie' },
>  ];
>

I think that I miss understood then, It seems that you were trying to
imply that there would be a need to delever some notation that was not
in the stream of tests. I can see the need to have in line msg's, but
does this point to #4, notes about the the testing stream?

> That represents in TAP...
>
> not ok 1
>  ---
>  have: foo
>  want: bar
>  file: t/foo.t
>  line: 23
>  ...
> not ok 2
> # Failed test in t/foo.t at line 23.
> # I like pie
>
> Except they'd all be objects.

Aggreed.

 2 test result objects and 1 message object.
>
> Test::Builder2::History already stores this, but it doesn't hold onto
> unrelated messages.  I don't know if its worthwhile to do so, I haven't heard
> a use case for it.  It's getting close to round tripping.
>
> I suppose if there's an output format that absolutely does not stream, one
> that can't be built up as we go, it would need to store everything and output
> in one shot.  Even XML isn't that inflexible.
>
>
>> I know that TAP has some limitations in the formating of #2 and #3 but
>> is there any reason to keep that limitation in the way that things are
>> structured?
>
> Nope.
>
>

horray!

-- 
benh~

http://three.sentenc.es/


More information about the Pdx-pm-list mailing list