10 use strict; # Amazed that this hackery can be made strict ...
12 # Just a complete test for format, including top-, left- and bottom marging
13 # and format detection through glob entries
16 my $ps = $^L; $^L = ""; # Catch the page separator
17 my $tm = 1; # Top margin (empty lines before first output)
18 my $bm = 2; # Bottom marging (empty lines between last text and footer)
19 my $lm = 4; # Left margin (indent in spaces)
21 if ($lm > 0 and !open STDOUT, "|-") { # Left margin (in this test ALWAYS set)
26 print + ($_ eq <DATA> ? "" : "not "), "ok ", $i++, "\n";
29 print + (<DATA>?"not ":""), "ok ", $i++, "\n";
34 $= -= $bm + 1; # count one for the trailing "----"
47 $% == 1 and return "";
49 $lastmin < $= and print "\n" x $lastmin;
50 print "\n" x $bm, "----\n", $ps;
55 # Yes, this is sick ;-)
68 @{(shift @E)||["",""]}
78 exists $::{$fmt} or return 0;
79 $^O eq "MSWin32" or return defined *{$::{$fmt}}{FORMAT};
80 open my $null, "> /dev/null" or die;
81 my $fh = select $null;
88 $^ = has_format ("TOP") ? "TOP" : "EmptyTOP";
89 has_format ("ENTRY") or die "No format defined for ENTRY";
90 foreach my $e ( [ map { [ $_, "Test$_" ] } 1 .. 7 ],
91 [ map { [ $_, "${_}tseT" ] } 1 .. 5 ]) {
95 has_format ("EOR") or next;
99 if (has_format ("EOF")) {