Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: getting better harness output with Test::Class

1 view
Skip to first unread message

Ovid

unread,
Nov 20, 2007, 3:37:42 AM11/20/07
to Andy Armstrong, Adrian Howard, Perl QA List
----- Original Message ----
> From: Andy Armstrong <an...@hexten.net>

>
http://testanything.org/wiki/index.php/Test_Groups
> http://testanything.org/wiki/index.php/Test_Blocks

I prefer test blocks for readability, but the example in the wiki is wrong. Remove the 'non-TAP' stuff and it doesn't render as TAP. Here's a corrected version:


TAP version 14
1..4
ok 1 - testing
begin 1 Object creation
1..2
ok 1 Object created OK
ok 2 Object isa Flunge::Twizzler
end 1 Object creation
ok 2 Clone OK
begin 3 Methods
1..4
ok 1 has twizzle method
ok 2 has burnish method
ok 3 has spangle method
not ok 4 has frob method
end 3 Methods
ok 3 another test
ok 4 Resources releasedHere's what an older TAP parser will see:

To be fair, I'd prefer to see the begin and end tokens indented, too, as I think that's much easier for vertical (human) scanning. I can tell at a glance what the top level tests are and that they passed.

TAP version 14
1..4
ok 1 - testing
begin 1 Object creation
1..2
ok 1 Object created OK
ok 2 Object isa Flunge::Twizzler
end 1 Object creation
ok 2 Clone OK
begin 3 Methods
1..4
ok 1 has twizzle method
ok 2 has burnish method
ok 3 has spangle method
not ok 4 has frob method
end 3 Methods
ok 3 another test
ok 4 Resources releasedHere's what an older TAP parser will see:

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/

Andy Armstrong

unread,
Nov 20, 2007, 4:47:28 AM11/20/07
to Ovid, Adrian Howard, Perl QA List

On 20 Nov 2007, at 08:37, Ovid wrote:
> To be fair, I'd prefer to see the begin and end tokens indented,
> too, as I think that's much easier for vertical (human) scanning. I
> can tell at a glance what the top level tests are and that they
> passed.


Agreed. Although funnily enough I originally indented the example only
to make the structure clear and didn't intend it as part of the
syntax :)

--
Andy Armstrong, Hexten


0 new messages