1*0Sstevel@tonic-gate#!./perl -w 2*0Sstevel@tonic-gate 3*0Sstevel@tonic-gateuse Test::More tests => 3; 4*0Sstevel@tonic-gate 5*0Sstevel@tonic-gateopen(POD, ">$$.pod") or die "$$.pod: $!"; 6*0Sstevel@tonic-gateprint POD <<__EOF__; 7*0Sstevel@tonic-gate=pod 8*0Sstevel@tonic-gate 9*0Sstevel@tonic-gate=head1 NAME 10*0Sstevel@tonic-gate 11*0Sstevel@tonic-gatecrlf 12*0Sstevel@tonic-gate 13*0Sstevel@tonic-gate=head1 DESCRIPTION 14*0Sstevel@tonic-gate 15*0Sstevel@tonic-gatecrlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf 16*0Sstevel@tonic-gatecrlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf 17*0Sstevel@tonic-gatecrlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf 18*0Sstevel@tonic-gatecrlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf 19*0Sstevel@tonic-gate 20*0Sstevel@tonic-gate crlf crlf crlf crlf 21*0Sstevel@tonic-gate crlf crlf crlf crlf 22*0Sstevel@tonic-gate crlf crlf crlf crlf 23*0Sstevel@tonic-gate 24*0Sstevel@tonic-gatecrlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf 25*0Sstevel@tonic-gatecrlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf 26*0Sstevel@tonic-gatecrlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf 27*0Sstevel@tonic-gatecrlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf 28*0Sstevel@tonic-gate 29*0Sstevel@tonic-gate=cut 30*0Sstevel@tonic-gate__EOF__ 31*0Sstevel@tonic-gateclose(POD); 32*0Sstevel@tonic-gate 33*0Sstevel@tonic-gateuse Pod::Html; 34*0Sstevel@tonic-gate 35*0Sstevel@tonic-gate# --- CR --- 36*0Sstevel@tonic-gate 37*0Sstevel@tonic-gateopen(POD, "<$$.pod") or die "$$.pod: $!"; 38*0Sstevel@tonic-gateopen(IN, ">$$.in") or die "$$.in: $!"; 39*0Sstevel@tonic-gatewhile (<POD>) { 40*0Sstevel@tonic-gate s/[\r\n]+/\r/g; 41*0Sstevel@tonic-gate print IN $_; 42*0Sstevel@tonic-gate} 43*0Sstevel@tonic-gateclose(POD); 44*0Sstevel@tonic-gateclose(IN); 45*0Sstevel@tonic-gate 46*0Sstevel@tonic-gatepod2html("--title=eol", "--infile=$$.in", "--outfile=$$.o1"); 47*0Sstevel@tonic-gate 48*0Sstevel@tonic-gate# --- LF --- 49*0Sstevel@tonic-gate 50*0Sstevel@tonic-gateopen(POD, "<$$.pod") or die "$$.pod: $!"; 51*0Sstevel@tonic-gateopen(IN, ">$$.in") or die "$$.in: $!"; 52*0Sstevel@tonic-gatewhile (<POD>) { 53*0Sstevel@tonic-gate s/[\r\n]+/\n/g; 54*0Sstevel@tonic-gate print IN $_; 55*0Sstevel@tonic-gate} 56*0Sstevel@tonic-gateclose(POD); 57*0Sstevel@tonic-gateclose(IN); 58*0Sstevel@tonic-gate 59*0Sstevel@tonic-gatepod2html("--title=eol", "--infile=$$.in", "--outfile=$$.o2"); 60*0Sstevel@tonic-gate 61*0Sstevel@tonic-gate# --- CRLF --- 62*0Sstevel@tonic-gate 63*0Sstevel@tonic-gateopen(POD, "<$$.pod") or die "$$.pod: $!"; 64*0Sstevel@tonic-gateopen(IN, ">$$.in") or die "$$.in: $!"; 65*0Sstevel@tonic-gatewhile (<POD>) { 66*0Sstevel@tonic-gate s/[\r\n]+/\r\n/g; 67*0Sstevel@tonic-gate print IN $_; 68*0Sstevel@tonic-gate} 69*0Sstevel@tonic-gateclose(POD); 70*0Sstevel@tonic-gateclose(IN); 71*0Sstevel@tonic-gate 72*0Sstevel@tonic-gatepod2html("--title=eol", "--infile=$$.in", "--outfile=$$.o3"); 73*0Sstevel@tonic-gate 74*0Sstevel@tonic-gate# --- now test --- 75*0Sstevel@tonic-gate 76*0Sstevel@tonic-gatelocal $/; 77*0Sstevel@tonic-gate 78*0Sstevel@tonic-gateopen(IN, "<$$.o1") or die "$$.o1: $!"; 79*0Sstevel@tonic-gatemy $cksum1 = unpack("%32C*", <IN>); 80*0Sstevel@tonic-gate 81*0Sstevel@tonic-gateopen(IN, "<$$.o2") or die "$$.o2: $!"; 82*0Sstevel@tonic-gatemy $cksum2 = unpack("%32C*", <IN>); 83*0Sstevel@tonic-gate 84*0Sstevel@tonic-gateopen(IN, "<$$.o3") or die "$$.o3: $!"; 85*0Sstevel@tonic-gatemy $cksum3 = unpack("%32C*", <IN>); 86*0Sstevel@tonic-gate 87*0Sstevel@tonic-gateok($cksum1 == $cksum2, "CR vs LF"); 88*0Sstevel@tonic-gateok($cksum1 == $cksum3, "CR vs CRLF"); 89*0Sstevel@tonic-gateok($cksum2 == $cksum3, "LF vs CRLF"); 90*0Sstevel@tonic-gateclose IN; 91*0Sstevel@tonic-gate 92*0Sstevel@tonic-gateEND { 93*0Sstevel@tonic-gate 1 while unlink("$$.pod", "$$.in", "$$.o1", "$$.o2", "$$.o3", 94*0Sstevel@tonic-gate "pod2htmd.x~~", "pod2htmi.x~~"); 95*0Sstevel@tonic-gate} 96