4 if( $ENV{PERL_CORE} ) {
6 @INC = ('../lib', 'lib', '../lib/Test/Simple/t/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, "cmp_ok");
33 $TB->is_num(!!$ok, !!$expect{ok}, " right return");
35 my $diag = $err->read;
36 if( !$ok and $expect{error} ) {
38 $TB->like( $diag, qr/\Q$expect{error}\E/, " expected error" );
41 $TB->is_eq( $diag, '', " passed without diagnostic" );
44 $TB->ok(1, " failed without diagnostic");
50 Test::More->builder->no_ending(1);
53 my $cmp = Overloaded::Compare->new("foo", 42);
54 my $ify = Overloaded::Ify->new("bar", 23);
70 plan tests => scalar @Tests;
71 $TB->plan(tests => @Tests * 2);
73 for my $test (@Tests) {