-1
  ,   ˆl–äY>”*a,j
€fã-ÜjbÑ¿È„ÿ_‡I|¥„ØyeÄÇ ){    #!perl -w

BEGIN {
    if( $ENV{PERL_CORE} ) {
        chdir 't';
        @INC = ('../lib', 'lib');
    }
    else {
        unshift @INC, 't/lib';
    }
}

use strict;

require Test::Simple::Catch;
my($out, $err) = Test::Simple::Catch::caught();
local $ENV{HARNESS_ACTIVE} = 0;


# Can't use Test.pm, that's a 5.005 thing.
package My::Test;

# This has to be a require or else the END block below runs before
# Test::Builder's own and the ending diagnostics don't come out right.
require Test::Builder;
my $TB = Test::Builder->create;
$TB->plan(tests => 80);

sub like ($$;$) {
    $TB->like(@_);
}

sub is ($$;$) {
    $TB->is_eq(@_);
}

sub main::out_ok ($$) {
    $TB->is_eq( $out->read, shift );
    $TB->is_eq( $err->read, shift );
}

sub main::out_like ($$) {
    my($output, $failure) = @_;

    $TB->like( $out->read, qr/$output/ );
    $TB->like( $err->read, qr/$failure/ );
}


package main;

require Test::More;
our $TODO;
my $Total = 38;
Test::More->import(tests => $Total);
$out->read;  # clear the plan from $out

# This should all work in the presence of a __DIE__ handler.
local $SIG{__DIE__} = sub { $TB->ok(0, "DIE handler called: ".join "", @_); };


my $tb = Test::More->builder;
$tb->use_numbers(0);

my $Filename = quotemeta $0;


#line 38
ok( 0, 'failing' );
out_ok( <<OUT, <<ERR );
not ok - failing
OUT
#   Failed test 'failing'
#   at $0 line 38.
ERR


#line 40
is( "foo", "bar", 'foo is bar?');
out_ok( <<OUT, <<ERR );
not ok - foo is bar?
OUT
#   Failed test 'foo is bar?'
#   at $0 line 40.
#          got: 'foo'
#     expected: 'bar'
ERR

#line 89
is( undef, '',    'undef is empty string?');
out_ok( <<OUT, <<ERR );
not ok - undef is empty string?
OUT
#   Failed test 'undef is empty string?'
#   at $0 line 89.
#          got: undef
#     expected: ''
ERR

#line 99
is( undef, 0,     'undef is 0?');
out_ok( <<OUT, <<ERR );
not ok - undef is 0?
OUT
#   Failed test 'undef is 0?'
#   at $0 line 99.
#          got: undef
#     expected: '0'
ERR

#line 110
is( '',    0,     'empty string is 0?' );
out_ok( <<OUT, <<ERR );
not ok - empty string is 0?
OUT
#   Failed test 'empty string is 0?'
#   at $0 line 110.
#          got: ''
#     expected: '0'
ERR

#line 121
isnt("foo", "foo", 'foo isnt foo?' );
out_ok( <<OUT, <<ERR );
not ok - foo isnt foo?
OUT
#   Failed test 'foo isnt foo?'
#   at $0 line 121.
#          got: 'foo'
#     expected: anything else
ERR

#line 132
isn't("foo", "foo",'foo isn\'t foo?' );
out_ok( <<OUT, <<ERR );
not ok - foo isn't foo?
OUT
#   Failed test 'foo isn\'t foo?'
#   at $0 line 132.
#          got: 'foo'
#     expected: anything else
ERR

#line 143
isnt(undef, undef, 'undef isnt undef?');
out_ok( <<OUT, <<ERR );
not ok - undef isnt undef?
OUT
#   Failed test 'undef isnt undef?'
#   at $0 line 143.
#          got: undef
#     expected: anything else
ERR

#line 154
like( "foo", '/that/',  'is foo like that' );
out_ok( <<OUT, <<ERR );
not ok - is foo like that
OUT
#   Failed test 'is foo like that'
#   at $0 line 154.
#                   'foo'
#     doesn't match '/that/'
ERR

#line 165
unlike( "foo", '/foo/', 'is foo unlike foo' );
out_ok( <<OUT, <<ERR );
not ok - is foo unlike foo
OUT
#   Failed test 'is foo unlike foo'
#   at $0 line 165.
#                   'foo'
#           matches '/foo/'
ERR

# Nick Clark found this was a bug.  Fixed in 0.40.
# line 177
like( "bug", '/(%)/',   'regex with % in it' );
out_ok( <<OUT, <<ERR );
not ok - regex with % in it
OUT
#   Failed test 'regex with % in it'
#   at $0 line 177.
#                   'bug'
#     doesn't match '/(%)/'
ERR

#line 188
fail('fail()');
out_ok( <<OUT, <<ERR );
not ok - fail()
OUT
#   Failed test 'fail()'
#   at $0 line 188.
ERR

#line 197
can_ok('Mooble::Hooble::Yooble', qw(this that));
out_ok( <<OUT, <<ERR );
not ok - Mooble::Hooble::Yooble->can(...)
OUT
#   Failed test 'Mooble::Hooble::Yooble->can(...)'
#   at $0 line 197.
#     Mooble::Hooble::Yooble->can('this') failed
#     Mooble::Hooble::Yooble->can('that') failed
ERR

#line 208
can_ok('Mooble::Hooble::Yooble', ());
