1 # qr// was introduced in 5.004-devel. Skip this test if we're not
2 # of high enough version.
5 print "1..0 # Skipped Test requires qr//\n";
11 if( $ENV{PERL_CORE} ) {
13 @INC = ('../lib', 'lib');
16 unshift @INC, 't/lib';
20 # There was a bug with like() involving a qr// not failing properly.
21 # This tests against that.
26 # Can't use Test.pm, that's a 5.005 thing.
29 # This has to be a require or else the END block below runs before
30 # Test::Builder's own and the ending diagnostics don't come out right.
31 require Test::Builder;
32 my $TB = Test::Builder->create;
33 $TB->plan(tests => 2);
36 require Test::Simple::Catch;
37 my($out, $err) = Test::Simple::Catch::caught();
38 local $ENV{HARNESS_ACTIVE} = 0;
44 Test::More->import(tests => 1);
46 eval q{ like( "foo", qr/that/, 'is foo like that' ); };
50 $TB->is_eq($$out, <<OUT, 'failing output');
52 not ok 1 - is foo like that
56 # Failed test 'is foo like that'
59 # doesn't match '\\(\\?-xism:that\\)'
60 # Looks like you failed 1 test of 1\\.
64 $TB->like($$err, qr/^$err_re$/, 'failing errors');