t/comp/cmdopt.t See if command optimization works
t/comp/colon.t See if colons are parsed correctly
t/comp/decl.t See if declarations work
+t/comp/filter_exception.t See if $@ survives source filters
t/comp/final_line_num.t See if line numbers are correct at EOF
t/comp/fold.t See if constant folding works
t/comp/form_scope.t See if format scoping works
--- /dev/null
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ require './test.pl';
+}
+
+plan tests => 4;
+
+BEGIN {
+ unshift @INC, sub {
+ return () unless $_[1] =~ m#\At/(Foo|Bar)\.pm\z#;
+ my $t = 0;
+ return sub {
+ if(!$t) {
+ $_ = "int(1,2);\n";
+ $t = 1;
+ $@ = "wibble";
+ return 1;
+ } else {
+ return 0;
+ }
+ };
+ };
+}
+
+is +(do "t/Bar.pm"), undef;
+like $@, qr/\AToo many arguments for int /;
+is eval { require "t/Foo.pm" }, undef;
+like $@, qr/\AToo many arguments for int /;
+
+1;
# Some tests in t/comp need to use require or use to get their job done:
my %exceptions = (
+ filter_exception => "require './test.pl'",
hints => "require './test.pl'",
parser => 'use DieDieDie',
parser_run => "require './test.pl'",
Perl_filter_read(pTHX_ int idx, SV *buf_sv, int maxlen)
{
filter_t funcp;
+ I32 ret;
SV *datasv = NULL;
/* This API is bad. It should have been using unsigned int for maxlen.
Not sure if we want to change the API, but if not we should sanity
/* Call function. The function is expected to */
/* call "FILTER_READ(idx+1, buf_sv)" first. */
/* Return: <0:error, =0:eof, >0:not eof */
- return (*funcp)(aTHX_ idx, buf_sv, correct_length);
+ ENTER;
+ save_scalar(PL_errgv);
+ ret = (*funcp)(aTHX_ idx, buf_sv, correct_length);
+ LEAVE;
+ return ret;
}
STATIC char *