4 if( $ENV{PERL_CORE} ) {
6 @INC = ('../lib', 'lib');
13 # There was a bug with like() involving a qr// not failing properly.
14 # This tests against that.
19 # Can't use Test.pm, that's a 5.005 thing.
22 # This has to be a require or else the END block below runs before
23 # Test::Builder's own and the ending diagnostics don't come out right.
24 require Test::Builder;
25 my $TB = Test::Builder->create;
26 $TB->plan(tests => 4);
29 require Test::Simple::Catch;
30 my($out, $err) = Test::Simple::Catch::caught();
31 local $ENV{HARNESS_ACTIVE} = 0;
37 Test::More->import(tests => 1);
40 eval q{ like( "foo", qr/that/, 'is foo like that' ); };
42 $TB->is_eq($out->read, <<OUT, 'failing output');
44 not ok 1 - is foo like that
48 # Failed test 'is foo like that'
51 # doesn't match '\\(\\?-xism:that\\)'
54 $TB->like($err->read, qr/^$err_re$/, 'failing errors');
59 like("foo", "not a regex");
60 $TB->is_eq($out->read, <<OUT);
64 $TB->is_eq($err->read, <<OUT);
65 # Failed test at $0 line 59.
66 # 'not a regex' doesn't look much like a regex to me.
72 # Test::More thinks it failed. Override that.
73 exit(scalar grep { !$_ } $TB->summary);