This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Move Test::Simple from ext/ to cpan/
[perl5.git] / cpan / Test-Simple / t / Builder / done_testing_double.t
CommitLineData
3e887aae
DM
1#!/usr/bin/perl -w
2
3use strict;
45d8b36e
DM
4BEGIN {
5 if( $ENV{PERL_CORE} ) {
6 chdir 't';
7 @INC = ('../lib', 'lib');
8 }
9 else {
10 unshift @INC, 't/lib';
11 }
12}
3e887aae
DM
13
14use Test::Builder;
15use Test::Builder::NoOutput;
16
17my $tb = Test::Builder::NoOutput->create;
18
19{
20 # Normalize test output
21 local $ENV{HARNESS_ACTIVE};
22
23 $tb->ok(1);
24 $tb->ok(1);
25 $tb->ok(1);
26
27#line 24
28 $tb->done_testing(3);
29 $tb->done_testing;
30 $tb->done_testing;
31}
32
33my $Test = Test::Builder->new;
34$Test->plan( tests => 1 );
35$Test->level(0);
36$Test->is_eq($tb->read, <<"END", "multiple done_testing");
37ok 1
38ok 2
39ok 3
401..3
41not ok 4 - done_testing() was already called at $0 line 24
42# Failed test 'done_testing() was already called at $0 line 24'
43# at $0 line 25.
44not ok 5 - done_testing() was already called at $0 line 24
45# Failed test 'done_testing() was already called at $0 line 24'
46# at $0 line 26.
47END