Commit | Line | Data |
3e887aae |
1 | #!/usr/bin/perl -w |
2 | |
3 | # Test what happens when no plan is delcared and done_testing() is not seen |
4 | |
5 | use strict; |
45d8b36e |
6 | BEGIN { |
7 | if( $ENV{PERL_CORE} ) { |
8 | chdir 't'; |
9 | @INC = ('../lib', 'lib'); |
10 | } |
11 | else { |
12 | unshift @INC, 't/lib'; |
13 | } |
14 | } |
3e887aae |
15 | |
16 | use Test::Builder; |
17 | use Test::Builder::NoOutput; |
18 | |
19 | my $Test = Test::Builder->new; |
20 | $Test->level(0); |
21 | $Test->plan( tests => 1 ); |
22 | |
23 | my $tb = Test::Builder::NoOutput->create; |
24 | |
25 | { |
26 | $tb->level(0); |
27 | $tb->ok(1, "just a test"); |
28 | $tb->ok(1, " and another"); |
29 | $tb->_ending; |
30 | } |
31 | |
32 | $Test->is_eq($tb->read, <<'END', "proper behavior when no plan is seen"); |
33 | ok 1 - just a test |
34 | ok 2 - and another |
35 | # Tests were run but no plan was declared and done_testing() was not seen. |
36 | END |