summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
04fbdaa)
Try to open the missing file in the same way PLP::source() will,
to obtain the same warning message.
For example MSWin32-x86-multi-thread said:
Can't open "C:\Perl\cpan\build\PLP-3.22-ZfVju5\missinginclude" (No such file or directory)
while several CPANTS linuxes were localized:
Can't open "/tmp/missinginclude" (Datei oder Verzeichnis nicht gefunden)
--- #YAML:1.0
name: PLP
abstract: Perl in HTML pages
--- #YAML:1.0
name: PLP
abstract: Perl in HTML pages
version_from: PLP.pm
author:
- Mischa POSLAWSKY <perl@shiar.org>
version_from: PLP.pm
author:
- Mischa POSLAWSKY <perl@shiar.org>
provides:
PLP:
file: lib/PLP.pm
provides:
PLP:
file: lib/PLP.pm
PLP::Script:
file: lib/PLP.pm
PLP::Functions:
PLP::Script:
file: lib/PLP.pm
PLP::Functions:
use strict;
use warnings;
use strict;
use warnings;
+our $VERSION = '3.22_01';
# Subs in this package:
# _default_error($plain, $html) Default error handler
# Subs in this package:
# _default_error($plain, $html) Default error handler
+SKIP: {
+
+my $INCFILE = File::Spec->rel2abs("$base/missinginclude");
+if (open my $dummy, "<", $INCFILE) { # like PLP::source will
+ fail("file missinginclude shouldn't exist");
+ skip("missinginclude tests", 2);
+}
+my $INCWARN = qq{Can't open "$INCFILE" ($!)};
+
plp_is('warnings', split /\n\n/, <<TEST, 2);
1
<: use warnings :>
plp_is('warnings', split /\n\n/, <<TEST, 2);
1
<: use warnings :>
warning at $testfile line 6.
4
warning at $testfile line 6.
4
-<table border=1 class="PLPerror"><tr><td><b>Debug information:</b><br>Can't open "$base/missinginclude" (No such file or directory) at $testfile line 8.
+<table border=1 class="PLPerror"><tr><td><b>Debug information:</b><br>$INCWARN at $testfile line 8.
-<table border=1 class="PLPerror"><tr><td><b>Debug information:</b><br>Can't open "$base/missinginclude" (No such file or directory) at $testfile line 10.
+<table border=1 class="PLPerror"><tr><td><b>Debug information:</b><br>$INCWARN at $testfile line 10.
</td></tr></table>
TEST
plp_is('$PLP::ERROR',
'<: $PLP::ERROR = sub {print "Oh no: $_[0]"} :> <(missinginclude)>.',
</td></tr></table>
TEST
plp_is('$PLP::ERROR',
'<: $PLP::ERROR = sub {print "Oh no: $_[0]"} :> <(missinginclude)>.',
- qq{$HEAD\n Oh no: Can't open "$base/missinginclude" (No such file or directory) at $testfile line 1.\n\n}
+ qq{$HEAD\n Oh no: $INCWARN at $testfile line 1.\n\n}
"Content-Type: text/plain\n\nContent-Type: text/html\n\n1"
);
"Content-Type: text/plain\n\nContent-Type: text/html\n\n1"
);
plp_is('utf8', '<: use open qw/:std :utf8/; print chr 191', <<TEST);
Content-Type: text/html; charset=utf-8
X-PLP-Version: $PLP::VERSION
plp_is('utf8', '<: use open qw/:std :utf8/; print chr 191', <<TEST);
Content-Type: text/html; charset=utf-8
X-PLP-Version: $PLP::VERSION