Clear up test based on line number differences between the core and the
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / extra_one.t
CommitLineData
30e302f8 1#!/usr/bin/perl -w
2
3BEGIN {
4 if( $ENV{PERL_CORE} ) {
5 chdir 't';
6 @INC = ('../lib', 'lib');
7 }
8 else {
9 unshift @INC, 't/lib';
10 }
11}
12
13use strict;
14
15require Test::Simple::Catch;
16my($out, $err) = Test::Simple::Catch::caught();
17
18# Can't use Test.pm, that's a 5.005 thing.
19package My::Test;
20
b1ddf169 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.
23require Test::Builder;
24my $TB = Test::Builder->create;
25$TB->plan(tests => 2);
26
27sub is { $TB->is_eq(@_) }
30e302f8 28
29
30package main;
31
32require Test::Simple;
33Test::Simple->import(tests => 1);
34ok(1);
35ok(1);
36ok(1);
37
38END {
b1ddf169 39 My::Test::is($$out, <<OUT);
30e302f8 401..1
41ok 1
42ok 2
43ok 3
44OUT
45
b1ddf169 46 My::Test::is($$err, <<ERR);
30e302f8 47# Looks like you planned 1 test but ran 2 extra.
48ERR
49
50 # Prevent Test::Simple from existing with non-zero
51 exit 0;
52}