Commit | Line | Data |
---|---|---|
2c4d5b9b SH |
1 | #!/usr/bin/env perl |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
6 | use lib '../lib'; | |
7 | use Test::Builder; | |
8 | ||
9 | =head1 NOTES | |
10 | ||
11 | Must have explicit finalize | |
12 | Must name nest | |
13 | Trailing summary test | |
14 | Pass chunk o'TAP | |
15 | No builder may have more than one child active | |
16 | What happens if you call ->finalize with open children | |
17 | ||
18 | =cut | |
19 | ||
20 | my $builder = Test::Builder->new; | |
21 | $builder->plan(tests => 7); | |
22 | for( 1 .. 3 ) { | |
23 | $builder->ok( $_, "We're on $_" ); | |
24 | $builder->note("We ran $_"); | |
25 | } | |
26 | { | |
27 | my $indented = $builder->child; | |
28 | $indented->plan('no_plan'); | |
29 | for( 1 .. 1+int(rand(5)) ) { | |
30 | $indented->ok( 1, "We're on $_" ); | |
31 | } | |
32 | $indented->finalize; | |
33 | } | |
34 | for( 7, 8, 9 ) { | |
35 | $builder->ok( $_, "We're on $_" ); | |
36 | } |