From e9ce9c73d646d9031069b35dd37dd9722353f3f2 Mon Sep 17 00:00:00 2001 From: Paul Johnson Date: Wed, 26 Sep 2012 02:44:44 +0200 Subject: [PATCH] Test for errors requiring .ph files. --- t/op/require_errors.t | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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'; -- 2.7.4