In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/e9ce9c73d646d9031069b35dd37dd9722353f3f2?hp=b3045d9c1f82f3a16ffa240a2b4e501855d2f95e>
- Log ----------------------------------------------------------------- commit e9ce9c73d646d9031069b35dd37dd9722353f3f2 Author: Paul Johnson <[email protected]> Date: Wed Sep 26 02:44:44 2012 +0200 Test for errors requiring .ph files. M t/op/require_errors.t commit eccba0447e537a14ae12e1894864fbd54032178c Author: Father Chrysostomos <[email protected]> Date: Tue Sep 25 14:46:35 2012 -0700 Correct fm vtable in perlguts.pod fm magic uses want_vtbl_fm, which is #defined as want_vtbl_regexp. The definition in regen/mg_vtable.pl does not affect anything except the documentation. It was listed as using regdata which was wrong. M mg_raw.h M pod/perlguts.pod M regen/mg_vtable.pl ----------------------------------------------------------------------- Summary of changes: mg_raw.h | 2 +- pod/perlguts.pod | 2 +- regen/mg_vtable.pl | 2 +- t/op/require_errors.t | 11 ++++++++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/mg_raw.h b/mg_raw.h index 3fd2992..487e209 100644 --- a/mg_raw.h +++ b/mg_raw.h @@ -34,7 +34,7 @@ "/* env 'E' %ENV hash */" }, { 'e', "want_vtbl_envelem", "/* envelem 'e' %ENV hash element */" }, - { 'f', "want_vtbl_regdata | PERL_MAGIC_READONLY_ACCEPTABLE | PERL_MAGIC_VALUE_MAGIC", + { 'f', "want_vtbl_regexp | PERL_MAGIC_READONLY_ACCEPTABLE | PERL_MAGIC_VALUE_MAGIC", "/* fm 'f' Formline ('compiled' format) */" }, { 'g', "want_vtbl_mglob | PERL_MAGIC_READONLY_ACCEPTABLE | PERL_MAGIC_VALUE_MAGIC", "/* regex_global 'g' m//g target */" }, diff --git a/pod/perlguts.pod b/pod/perlguts.pod index 76acf57..d1e179a 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -1077,7 +1077,7 @@ will be lost. element E PERL_MAGIC_env vtbl_env %ENV hash e PERL_MAGIC_envelem vtbl_envelem %ENV hash element - f PERL_MAGIC_fm vtbl_regdata Formline + f PERL_MAGIC_fm vtbl_regexp Formline ('compiled' format) g PERL_MAGIC_regex_global vtbl_mglob m//g target H PERL_MAGIC_hints vtbl_hints %^H hash diff --git a/regen/mg_vtable.pl b/regen/mg_vtable.pl index 9c722cf..5c42153 100644 --- a/regen/mg_vtable.pl +++ b/regen/mg_vtable.pl @@ -42,7 +42,7 @@ my %mg = env => { char => 'E', vtable => 'env', desc => '%ENV hash' }, envelem => { char => 'e', vtable => 'envelem', desc => '%ENV hash element' }, - fm => { char => 'f', vtable => 'regdata', value_magic => 1, + fm => { char => 'f', vtable => 'regexp', value_magic => 1, readonly_acceptable => 1, desc => "Formline ('compiled' format)" }, regex_global => { char => 'g', vtable => 'mglob', value_magic => 1, readonly_acceptable => 1, desc => 'm//g target' }, 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 <foom>'; like $@, qr/^<> should be quotes at /, 'require <> error'; -- Perl5 Master Repository
