Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add filename and line number to string eval #10

  • Loading branch information...
commit b020a3222c2968cc9f39845954ebc8df0ab1e17b 1 parent cddb822
Tatsuhiko Miyagawa authored
Showing with 11 additions and 1 deletion.
  1. +2 −1  lib/Module/CPANfile.pm
  2. +9 −0 t/parse.t
3  lib/Module/CPANfile.pm
View
@@ -142,6 +142,7 @@ no warnings;
my \$_result;
BEGIN { import Module::CPANfile::Environment \\\$_result };
+# line 1 "$file"
$code;
\$_result;
@@ -336,4 +337,4 @@ Tatsuhiko Miyagawa
L<cpanfile>, L<CPAN::Meta>, L<CPAN::Meta::Spec>
-=cut
+=cut
9 t/parse.t
View
@@ -17,6 +17,15 @@ use t::Utils;
{
my $r = write_cpanfile(<<FILE);
+foo();
+FILE
+ eval { Module::CPANfile->load };
+ like $@, qr/cpanfile line 1/;
+}
+
+
+{
+ my $r = write_cpanfile(<<FILE);
configure_requires 'ExtUtils::MakeMaker', 5.5;
requires 'DBI';
Please sign in to comment.
Something went wrong with that request. Please try again.