4 if( $ENV{PERL_CORE} ) {
6 @INC = ('../lib', 'lib');
15 require Test::Simple::Catch;
16 my($out, $err) = Test::Simple::Catch::caught();
17 local $ENV{HARNESS_ACTIVE} = 0;
19 require Test::Builder;
20 my $TB = Test::Builder->create;
24 my($left, $cmp, $right) = @_;
27 $expect{ok} = eval "\$left $cmp \$right";
29 $expect{error} =~ s/ at .*\n?//;
31 local $Test::Builder::Level = $Test::Builder::Level + 1;
32 my $ok = cmp_ok($left, $cmp, $right);
33 $TB->is_num(!!$ok, !!$expect{ok});
35 my $diag = $err->read;
36 if( !$ok and $expect{error} ) {
38 $TB->like( $diag, "/\Q$expect{error}\E/" );
41 $TB->is_eq( $diag, '' );
50 Test::More->builder->no_ending(1);
61 # These don't work yet.
63 #if( eval { require overload } ) {
66 my $cmp = Overloaded::Compare->new("foo", 42);
67 my $ify = Overloaded::Ify->new("bar", 23);
77 plan tests => scalar @Tests;
78 $TB->plan(tests => @Tests * 2);
80 for my $test (@Tests) {