This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #123963] "@<fullwidth digit>"
[perl5.git] / cpan / Test-Simple / t / Legacy / extra_one.t
1 #!/usr/bin/perl -w
2
3 BEGIN {
4     if( $ENV{PERL_CORE} ) {
5         chdir 't';
6         @INC = ('../lib', 'lib');
7     }
8     else {
9         unshift @INC, 't/lib';
10     }
11 }
12
13 use strict;
14
15 require Test::Simple::Catch;
16 my($out, $err) = Test::Simple::Catch::caught();
17
18 # Can't use Test.pm, that's a 5.005 thing.
19 package My::Test;
20
21 # This has to be a require or else the END block below runs before
22 # Test::Builder's own and the ending diagnostics don't come out right.
23 require Test::Builder;
24 my $TB = Test::Builder->create;
25 $TB->plan(tests => 2);
26
27 sub is { $TB->is_eq(@_) }
28
29
30 package main;
31
32 require Test::Simple;
33 Test::Simple->import(tests => 1);
34 ok(1);
35 ok(1);
36 ok(1);
37
38 END {
39     My::Test::is($$out, <<OUT);
40 1..1
41 ok 1
42 ok 2
43 ok 3
44 OUT
45
46     My::Test::is($$err, <<ERR);
47 # Looks like you planned 1 test but ran 3.
48 ERR
49
50     # Prevent Test::Simple from existing with non-zero
51     exit 0;
52 }