On 07/03/07, Andy Armstrong <[EMAIL PROTECTED]> wrote:
On 7 Mar 2007, at 12:10, Fergal Daly wrote:
> * nested blocks, each with it's own plan (or no plan)
> eg
> 1..3
> 1 OK
> 2 1..2 # start a block
> 2.1 1..3 # start another block
> 2.1.1 OK
> 2.1.2 OK
> 2.1.3 OK
> 2.1 OK # inner block was all good
> 2.2 OK
> 2 OK # outer block was all good
> 3 1..3
> 3.1 OK
> 3.2 OK
> 3 NOT OK # planned for 3 but only ran 2 tests
>
> this makes it real easy to count tests even when you do loops and
> functions, so it makes almost of all the reasons for using no_plan go
> away and when it doesn't it allows you to localise your no_plan to a
> specific block while continuing to count all your others.

I like that. I quite often rub up against inconvenience that would be
solved by being able to have nested groups of tests in a single test
script.

On Monday night I finally broke down and implemented nested blocks for
Test::Builder (second time to do this, first time required a patch to
TB, this time it's easier cos TB uses objects internally now). The
module is broken in many ways but I'll post it to CPAN later on anyway
because it'll probably be another week before I can work on it again,

F


--
Andy Armstrong, hexten.net


Reply via email to