From: Steve Hancock <perltidy@users.sourceforge.net> Date: Sun, 23 Aug 2020 14:38:41 +0000 (-0700) Subject: add test case for RT #133161, pod2html test X-Git-Tag: 20200907~44 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b2a0d6b947dff24d83aeaa303f625289a371e566;p=perltidy.git add test case for RT #133161, pod2html test --- diff --git a/t/snippets/expect/html2.def b/t/snippets/expect/html2.def new file mode 100644 index 00000000..714c1915 --- /dev/null +++ b/t/snippets/expect/html2.def @@ -0,0 +1,17 @@ + +=head1 Units and Measures + +=head2 Oven Temperatures + + Very Slow = 250F / 120C + Slow = 300F / 149C + Moderate = 350F / 177C + Hot = 400F / 204C + Very Hot = 450F / 232C + +=head2 Counting + + 1 dozen = 12 units + 12 dozen = 1 gross = 144 units + 12 gross = 1 great gross = 1728 units + diff --git a/t/snippets/expect/html2.html b/t/snippets/expect/html2.html new file mode 100644 index 00000000..4fc73917 --- /dev/null +++ b/t/snippets/expect/html2.html @@ -0,0 +1,75 @@ +<?xml version="1.0" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>perltidy</title> +<meta http-equiv="content-type" content="text/html; charset=utf-8" /> +<link rev="made" href="mailto:root@localhost" /> +</head> + +<style type="text/css"> +<!-- +/* default style sheet generated by perltidy */ +body {background: #FFFFFF; color: #000000} +pre { color: #000000; + background: #FFFFFF; + font-family: courier; + } + +.c { color: #228B22;} /* comment */ +.cm { color: #000000;} /* comma */ +.co { color: #000000;} /* colon */ +.h { color: #CD5555; font-weight:bold;} /* here-doc-target */ +.hh { color: #CD5555; font-style:italic;} /* here-doc-text */ +.i { color: #00688B;} /* identifier */ +.j { color: #CD5555; font-weight:bold;} /* label */ +.k { color: #8B008B; font-weight:bold;} /* keyword */ +.m { color: #FF0000; font-weight:bold;} /* subroutine */ +.n { color: #B452CD;} /* numeric */ +.p { color: #000000;} /* paren */ +.pd { color: #228B22; font-style:italic;} /* pod-text */ +.pu { color: #000000;} /* punctuation */ +.q { color: #CD5555;} /* quote */ +.s { color: #000000;} /* structure */ +.sc { color: #000000;} /* semicolon */ +.v { color: #B452CD;} /* v-string */ +.w { color: #000000;} /* bareword */ +--> +</style> +<body> +<a name="-top-"></a> +<h1>perltidy</h1> + + + +<ul id="index"> + <li><a href="#Units-and-Measures">Units and Measures</a> + <ul> + <li><a href="#Oven-Temperatures">Oven Temperatures</a></li> + <li><a href="#Counting">Counting</a></li> + </ul> + </li> +</ul> + +<h1 id="Units-and-Measures">Units and Measures</h1> + +<h2 id="Oven-Temperatures">Oven Temperatures</h2> + +<pre><code> Very Slow = 250F / 120C + Slow = 300F / 149C + Moderate = 350F / 177C + Hot = 400F / 204C + Very Hot = 450F / 232C</code></pre> + +<h2 id="Counting">Counting</h2> + +<pre><code> 1 dozen = 12 units + 12 dozen = 1 gross = 144 units + 12 gross = 1 great gross = 1728 units</code></pre> + + +<hr /><pre></pre></body> + +</html> + + diff --git a/t/snippets/html2.in b/t/snippets/html2.in new file mode 100644 index 00000000..31cfccc8 --- /dev/null +++ b/t/snippets/html2.in @@ -0,0 +1,16 @@ +=head1 Units and Measures + +=head2 Oven Temperatures + + Very Slow = 250F / 120C + Slow = 300F / 149C + Moderate = 350F / 177C + Hot = 400F / 204C + Very Hot = 450F / 232C + +=head2 Counting + + 1 dozen = 12 units + 12 dozen = 1 gross = 144 units + 12 gross = 1 great gross = 1728 units + diff --git a/t/snippets/packing_list.txt b/t/snippets/packing_list.txt index e29d1f17..1ea2f9cb 100644 --- a/t/snippets/packing_list.txt +++ b/t/snippets/packing_list.txt @@ -262,6 +262,8 @@ ../snippets21.t gnu7.gnu ../snippets21.t git33.def ../snippets21.t git33.git33 +../snippets21.t rt133130.def +../snippets21.t rt133130.rt133130 ../snippets3.t ce_wn1.ce_wn ../snippets3.t ce_wn1.def ../snippets3.t colin.colin @@ -402,5 +404,5 @@ ../snippets9.t rt98902.def ../snippets9.t rt98902.rt98902 ../snippets9.t rt99961.def -../snippets21.t rt133130.def -../snippets21.t rt133130.rt133130 +../snippets21.t html2.def +../snippets21.t html2.html diff --git a/t/snippets21.t b/t/snippets21.t index 52e4d78c..9d4e00c4 100644 --- a/t/snippets21.t +++ b/t/snippets21.t @@ -14,6 +14,8 @@ #11 git33.git33 #12 rt133130.def #13 rt133130.rt133130 +#14 html2.def +#15 html2.html # To locate test #13 you can search for its name or the string '#13' @@ -36,7 +38,11 @@ BEGIN { -wls='->' -wrs='->' ---------- - 'gnu' => "-gnu", + 'gnu' => "-gnu", + 'html' => <<'----------', +-fmt="html" +-nts +---------- 'lop' => "-nlop", 'rt133130' => <<'----------', # only the method should get a csc: @@ -85,6 +91,25 @@ else { # We're the third word to have this # abbreviation, so skip to the next word. next WORD; } +---------- + + 'html2' => <<'----------', +=head1 Units and Measures + +=head2 Oven Temperatures + + Very Slow = 250F / 120C + Slow = 300F / 149C + Moderate = 350F / 177C + Hot = 400F / 204C + Very Hot = 450F / 232C + +=head2 Counting + + 1 dozen = 12 units + 12 dozen = 1 gross = 144 units + 12 gross = 1 great gross = 1728 units + ---------- 'lop' => <<'----------', @@ -559,6 +584,112 @@ method sum_radlinks { } ## end sub sum_radlinks #13........... }, + + 'html2.def' => { + source => "html2", + params => "def", + expect => <<'#14...........', + +=head1 Units and Measures + +=head2 Oven Temperatures + + Very Slow = 250F / 120C + Slow = 300F / 149C + Moderate = 350F / 177C + Hot = 400F / 204C + Very Hot = 450F / 232C + +=head2 Counting + + 1 dozen = 12 units + 12 dozen = 1 gross = 144 units + 12 gross = 1 great gross = 1728 units + +#14........... + }, + + 'html2.html' => { + source => "html2", + params => "html", + expect => <<'#15...........', +<?xml version="1.0" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>perltidy</title> +<meta http-equiv="content-type" content="text/html; charset=utf-8" /> +<link rev="made" href="mailto:root@localhost" /> +</head> + +<style type="text/css"> +<!-- +/* default style sheet generated by perltidy */ +body {background: #FFFFFF; color: #000000} +pre { color: #000000; + background: #FFFFFF; + font-family: courier; + } + +.c { color: #228B22;} /* comment */ +.cm { color: #000000;} /* comma */ +.co { color: #000000;} /* colon */ +.h { color: #CD5555; font-weight:bold;} /* here-doc-target */ +.hh { color: #CD5555; font-style:italic;} /* here-doc-text */ +.i { color: #00688B;} /* identifier */ +.j { color: #CD5555; font-weight:bold;} /* label */ +.k { color: #8B008B; font-weight:bold;} /* keyword */ +.m { color: #FF0000; font-weight:bold;} /* subroutine */ +.n { color: #B452CD;} /* numeric */ +.p { color: #000000;} /* paren */ +.pd { color: #228B22; font-style:italic;} /* pod-text */ +.pu { color: #000000;} /* punctuation */ +.q { color: #CD5555;} /* quote */ +.s { color: #000000;} /* structure */ +.sc { color: #000000;} /* semicolon */ +.v { color: #B452CD;} /* v-string */ +.w { color: #000000;} /* bareword */ +--> +</style> +<body> +<a name="-top-"></a> +<h1>perltidy</h1> + + + +<ul id="index"> + <li><a href="#Units-and-Measures">Units and Measures</a> + <ul> + <li><a href="#Oven-Temperatures">Oven Temperatures</a></li> + <li><a href="#Counting">Counting</a></li> + </ul> + </li> +</ul> + +<h1 id="Units-and-Measures">Units and Measures</h1> + +<h2 id="Oven-Temperatures">Oven Temperatures</h2> + +<pre><code> Very Slow = 250F / 120C + Slow = 300F / 149C + Moderate = 350F / 177C + Hot = 400F / 204C + Very Hot = 450F / 232C</code></pre> + +<h2 id="Counting">Counting</h2> + +<pre><code> 1 dozen = 12 units + 12 dozen = 1 gross = 144 units + 12 gross = 1 great gross = 1728 units</code></pre> + + +<hr /><pre></pre></body> + +</html> + + +#15........... + }, }; my $ntests = 0 + keys %{$rtests};