#!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 => 17); sub like ($$;$) { $TB->like(@_); } sub is ($$;$) { $TB->is_eq(@_); } sub main::err_ok ($) { my($expect) = @_; my $got = $err->read; return $TB->is_eq( $got, $expect ); } package main; require Test::More; my $Total = 29; Test::More->import(tests => $Total); my $tb = Test::More->builder; $tb->use_numbers(0); my $Filename = quotemeta $0; # Preserve the line numbers. #line 38 ok( 0, 'failing' ); err_ok( <can(...)' # at $0 line 52. # Mooble::Hooble::Yooble->can('this') failed # Mooble::Hooble::Yooble->can('that') failed # Failed test 'Mooble::Hooble::Yooble->can(...)' # at $0 line 53. # can_ok() called with no methods # Failed test '->can(...)' # at $0 line 54. # can_ok() called with empty class or reference ERR #line 55 isa_ok(bless([], "Foo"), "Wibble"); isa_ok(42, "Wibble", "My Wibble"); isa_ok(undef, "Wibble", "Another Wibble"); isa_ok([], "HASH"); err_ok( <read, "/^$more_err_re/"); #line 85 require_ok('ALL::YOUR::BASE::ARE::BELONG::TO::US::wibble'); $more_err_re = <read, "/^$more_err_re/"); #line 88 END { $TB->is_eq($$out, <can(...) not ok - Mooble::Hooble::Yooble->can(...) not ok - ->can(...) not ok - The object isa Wibble not ok - My Wibble isa Wibble not ok - Another Wibble isa Wibble not ok - The object isa HASH not ok - cmp_ok eq not ok - == not ok - != not ok - && not ok - eq with numbers not ok - == with strings not ok - eq with stringified errno not ok - eq with numerified errno not ok - use Hooble::mooble::yooble; not ok - require ALL::YOUR::BASE::ARE::BELONG::TO::US::wibble; OUT err_ok( <