Talk:Test Blocks

From Test Anything Protocol

Jump to: navigation, search

From perl-qa:

On 20 Nov 2007, at 16:41, Adrian Howard wrote:

Having just glanced at these again it's occurred that if you change the "end" keyword in the block proposal to an "ok" / "not ok" (based on treating the block of tests as a successful/unsuccessful test run) you get:

 1..4
 begin 1 Object creation
   1..2
   ok 1 Object created OK
   ok 2 Object isa Flunge::Twizzler
 ok 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
 not ok 3 Methods
 ok 4 Resources released

which (I think) still reads nicely, and has the advantage of being 100% compatible with older parsers.

Makes more work for whatever is generating the TAP of course.

Just a thought...


... and Andy responded...

Oooh. I like that very much.

It means that if you're combining TAP you have to parse it to generate the summary result and also that the indentation becomes significant - which wasn't my original intention - but I'm OK with both of those things.