Debug information: Can't set headers after sending them at testfile.plp line 1.
-(Output started at testfile.plp line 1.)
- |
-TEST
+# 0*: permission checks using generated dummy files
+SKIP:
+for my $file (glob '0*.html') {
+ $file =~ s/[.]html$/.plp/;
+ my ($mode) = $file =~ /^..-(\d*)\b/;
+ eval {
+ if ($mode eq 404) {
+ return 1; # do not create
+ }
-#TODO: %post
-#TODO: %fields
-#TODO: %cookie
+ # prepare input
+ open my $out, '>', $file or die "cannot generate source file ($!)\n";
+ print {$out} 'ok';
-plp_is('PLP_END', '<: PLP_END{print 1}; PLP_END{print 2}; print 3', "$HEAD\n321");
+ if ($mode eq 403) {
+ chmod 0244, $file or die "cannot change permissions ($!)\n";
+ }
-plp_is('no warnings by default', '<: ignoreme :>ok', "$HEAD\nok");
+ return -e $file;
+ } or chomp $@, skip("$file: $@", 1); # ignore generation failure
-rename "$base/$testfile", "$base/$testfile.inc";
-plp_is('include', "<($testfile.inc)> <: include '$testfile.inc'", "$HEAD\nok ok");
-unlink "$base/$testfile.inc";
+ plp_ok($file);
+ eval { unlink $file }; # clean up
+}
-my $SYNTAXERR = getwarning("q\cq\n\cq; syntax(error", 1, $testfile);
-plp_is('fatal error', "runtime\n<: syntax(error :>\nruntime", <