4 if( $ENV{PERL_CORE} ) {
6 @INC = ('../lib', 'lib');
15 my $Test = Test::Builder->new;
17 $Test->plan( tests => 9 );
22 $Test->is_num( scalar $Test->summary(), 0, 'no tests yet, no summary' );
23 push @Expected_Details, { 'ok' => 1,
25 name => 'no tests yet, no summary',
30 # Inline TODO tests will confuse pre 1.20 Test::Harness, so we
31 # should just avoid the problem and not print it out.
32 my $start_test = $Test->current_test + 1;
35 $Test->output(\$output);
36 $Test->todo_output(\$output);
39 $Test->skip( 'just testing skip' );
41 push @Expected_Details, { 'ok' => 1,
45 reason => 'just testing skip',
49 local $TODO = 'i need a todo';
50 $Test->ok( 0, 'a test to todo!' );
52 push @Expected_Details, { 'ok' => 1,
54 name => 'a test to todo!',
56 reason => 'i need a todo',
59 $Test->todo_skip( 'i need both' );
61 push @Expected_Details, { 'ok' => 1,
65 reason => 'i need both'
68 for ($start_test..$Test->current_test) { print "ok $_\n" }
71 $Test->is_num( scalar $Test->summary(), 4, 'summary' );
72 push @Expected_Details, { 'ok' => 1,
79 $Test->current_test(6);
80 print "ok 6 - current_test incremented\n";
81 push @Expected_Details, { 'ok' => 1,
85 reason => 'incrementing test number',
88 my @details = $Test->details();
89 $Test->is_num( scalar @details, 6,
90 'details() should return a list of all test details');
93 is_deeply( \@details, \@Expected_Details );
96 # This test has to come last because it thrashes the test details.
98 my $curr_test = $Test->current_test;
99 $Test->current_test(4);
100 my @details = $Test->details();
102 $Test->current_test($curr_test);
103 $Test->is_num( scalar @details, 4 );