From: Paul Johnson Date: Wed, 26 Sep 2012 00:44:44 +0000 (+0200) Subject: Test for errors requiring .ph files. X-Git-Tag: upstream/5.20.0~5302 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e9ce9c73d646d9031069b35dd37dd9722353f3f2;p=platform%2Fupstream%2Fperl.git Test for errors requiring .ph files. --- diff --git a/t/op/require_errors.t b/t/op/require_errors.t index f617e6a..1f243a6 100644 --- a/t/op/require_errors.t +++ b/t/op/require_errors.t @@ -7,7 +7,7 @@ BEGIN { require './test.pl'; } -plan(tests => 9); +plan(tests => 11); my $nonfile = tempfile(); @@ -45,6 +45,15 @@ for my $file ("$nonfile.h", ".h") { "correct error message for require '$file'"; } +for my $file ("$nonfile.ph", ".ph") { + eval { + require $file + }; + + like $@, qr/^Can't locate \Q$file\E in \@INC \(did you run h2ph\?\) \(\@INC contains: @INC\) at/, + "correct error message for require '$file'"; +} + eval 'require '; like $@, qr/^<> should be quotes at /, 'require <> error';