1N/A#!./perl -w
1N/A
1N/Ause Test::More tests => 3;
1N/A
1N/Aopen(POD, ">$$.pod") or die "$$.pod: $!";
1N/Aprint POD <<__EOF__;
1N/A=pod
1N/A
1N/A=head1 NAME
1N/A
1N/Acrlf
1N/A
1N/A=head1 DESCRIPTION
1N/A
1N/Acrlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf
1N/Acrlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf
1N/Acrlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf
1N/Acrlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf
1N/A
1N/A crlf crlf crlf crlf
1N/A crlf crlf crlf crlf
1N/A crlf crlf crlf crlf
1N/A
1N/Acrlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf
1N/Acrlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf
1N/Acrlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf
1N/Acrlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf crlf
1N/A
1N/A=cut
1N/A__EOF__
1N/Aclose(POD);
1N/A
1N/Ause Pod::Html;
1N/A
1N/A# --- CR ---
1N/A
1N/Aopen(POD, "<$$.pod") or die "$$.pod: $!";
1N/Aopen(IN, ">$$.in") or die "$$.in: $!";
1N/Awhile (<POD>) {
1N/A s/[\r\n]+/\r/g;
1N/A print IN $_;
1N/A}
1N/Aclose(POD);
1N/Aclose(IN);
1N/A
1N/Apod2html("--title=eol", "--infile=$$.in", "--outfile=$$.o1");
1N/A
1N/A# --- LF ---
1N/A
1N/Aopen(POD, "<$$.pod") or die "$$.pod: $!";
1N/Aopen(IN, ">$$.in") or die "$$.in: $!";
1N/Awhile (<POD>) {
1N/A s/[\r\n]+/\n/g;
1N/A print IN $_;
1N/A}
1N/Aclose(POD);
1N/Aclose(IN);
1N/A
1N/Apod2html("--title=eol", "--infile=$$.in", "--outfile=$$.o2");
1N/A
1N/A# --- CRLF ---
1N/A
1N/Aopen(POD, "<$$.pod") or die "$$.pod: $!";
1N/Aopen(IN, ">$$.in") or die "$$.in: $!";
1N/Awhile (<POD>) {
1N/A s/[\r\n]+/\r\n/g;
1N/A print IN $_;
1N/A}
1N/Aclose(POD);
1N/Aclose(IN);
1N/A
1N/Apod2html("--title=eol", "--infile=$$.in", "--outfile=$$.o3");
1N/A
1N/A# --- now test ---
1N/A
1N/Alocal $/;
1N/A
1N/Aopen(IN, "<$$.o1") or die "$$.o1: $!";
1N/Amy $cksum1 = unpack("%32C*", <IN>);
1N/A
1N/Aopen(IN, "<$$.o2") or die "$$.o2: $!";
1N/Amy $cksum2 = unpack("%32C*", <IN>);
1N/A
1N/Aopen(IN, "<$$.o3") or die "$$.o3: $!";
1N/Amy $cksum3 = unpack("%32C*", <IN>);
1N/A
1N/Aok($cksum1 == $cksum2, "CR vs LF");
1N/Aok($cksum1 == $cksum3, "CR vs CRLF");
1N/Aok($cksum2 == $cksum3, "LF vs CRLF");
1N/Aclose IN;
1N/A
1N/AEND {
1N/A 1 while unlink("$$.pod", "$$.in", "$$.o1", "$$.o2", "$$.o3",
1N/A "pod2htmd.x~~", "pod2htmi.x~~");
1N/A}