Upgrade to Test-Simple-0.82.
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / extra_one.t
CommitLineData
30e302f8 1#!/usr/bin/perl -w
ccbd73a4 2# $Id: /mirror/googlecode/test-more/t/extra_one.t 57943 2008-08-18T02:09:22.275428Z brooklyn.kid51 $
30e302f8 3
4BEGIN {
5 if( $ENV{PERL_CORE} ) {
6 chdir 't';
7 @INC = ('../lib', 'lib');
8 }
9 else {
10 unshift @INC, 't/lib';
11 }
12}
13
14use strict;
15
16require Test::Simple::Catch;
17my($out, $err) = Test::Simple::Catch::caught();
18
19# Can't use Test.pm, that's a 5.005 thing.
20package My::Test;
21
b1ddf169 22# This has to be a require or else the END block below runs before
23# Test::Builder's own and the ending diagnostics don't come out right.
24require Test::Builder;
25my $TB = Test::Builder->create;
26$TB->plan(tests => 2);
27
28sub is { $TB->is_eq(@_) }
30e302f8 29
30
31package main;
32
33require Test::Simple;
34Test::Simple->import(tests => 1);
35ok(1);
36ok(1);
37ok(1);
38
39END {
b1ddf169 40 My::Test::is($$out, <<OUT);
30e302f8 411..1
42ok 1
43ok 2
44ok 3
45OUT
46
b1ddf169 47 My::Test::is($$err, <<ERR);
ccbd73a4 48# Looks like you planned 1 test but ran 3.
30e302f8 49ERR
50
51 # Prevent Test::Simple from existing with non-zero
52 exit 0;
53}