On Wed, Jun 25, 2003 at 02:25:11PM +0100, Fergal Daly wrote:
> I just wanted to bring up nested blocks and sub-plans again. I've been hacking
> around in Test::Builder and I've implemented something that works and does
> something that I think is useful. It allows you to write tests that have
> output like
>
> 1..5
> ok 1 - pass
> ok 2 - fail
> 1..3 a nested set of tests
> ok 1 - some test
> ok 2 - some other test
> 1..2 and another layer
> ok 1 - more tests
> ok 2 - another
> ok 3 - block 'an another layer'
> ok 3 - block 'a nested set of tests'
> ok 4 - pass
> ok 5 - fail
You don't want subtests to have to know any state, such as how far to indent.
Why? Consider:
is( $foo, $bar );
system("some_other_test.t");
Similar issue with tests that fork.
What would be really useful is to collect subplan use cases and put them
on the Wiki. That way we can have a use case and run the many, many
proposals against it to see if it solves the problems.
> The output above is compatible with Test::Harness because TH ignores lines
> beginning with whitespace. If a test fails inside a sub block, the error will
> propogate all the way to the outermost block so TH will see it. So you can
> test this out without modifying TH, although it would be nice if TH
> understood this format.
I don't think we can get away with T::H not being modified.
--
Michael G Schwern [EMAIL PROTECTED] http://www.pobox.com/~schwern/
<mendel> ScHWeRnsChweRN sChWErN SchweRN SCHWErNSChwERnsCHwERN
sChWErn ScHWeRn schweRn sCHWErN schWeRn scHWeRN
SchWeRN scHWErn SchwErn scHWErn ScHweRN sChwern
scHWerN scHWeRn scHWerN ScHwerN SChWeRN scHWeRn
SchwERNschwERn SCHwern sCHWErN SCHWErN sChWeRn