1 # qr// was introduced in 5.004-devel. Skip this test if we're not
2 # of high enough version.
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.
25 require Test::Simple::Catch;
26 my($out, $err) = Test::Simple::Catch::caught();
29 # Can't use Test.pm, that's a 5.005 thing.
35 # Utility testing functions.
37 my($test, $name) = @_;
39 $ok .= "not " unless $test;
40 $ok .= "ok $test_num";
41 $ok .= " - $name" if defined $name;
51 Test::More->import(tests => 1);
53 eval q{ like( "foo", qr/that/, 'is foo like that' ); };
57 My::Test::ok($$out eq <<OUT, 'failing output');
59 not ok 1 - is foo like that
63 # Failed test \\(.*\\)
65 # doesn't match '\\(\\?-xism:that\\)'
66 # Looks like you failed 1 tests of 1\\.
70 My::Test::ok($$err =~ /^$err_re$/, 'failing errors');