BEGIN {
if( $ENV{PERL_CORE} ) {
chdir 't';
@INC = ('../lib', 'lib');
}
else {
unshift @INC, 't/lib';
}
}
use strict;
package My::Test;
require Test::Builder;
my $TB = Test::Builder->create;
$TB->plan(tests => 4);
require Test::Simple::Catch;
my($out, $err) = Test::Simple::Catch::caught();
local $ENV{HARNESS_ACTIVE} = 0;
package main;
require Test::More;
Test::More->import(tests => 1);
{
eval q{ like( "foo", qr/that/, 'is foo like that' ); };
$TB->is_eq($out->read, <<OUT, 'failing output');
1..1
not ok 1 - is foo like that
OUT
my $err_re = <<ERR;
ERR
$TB->like($err->read, qr/^$err_re$/, 'failing errors');
}
{
like("foo", "not a regex");
$TB->is_eq($out->read, <<OUT);
not ok 2
OUT
$TB->is_eq($err->read, <<OUT);
OUT
}
END {
exit(scalar grep { !$_ } $TB->summary);
}