]> git.donarmstrong.com Git - perltidy.git/commitdiff
add test case for RT #133161, pod2html test
authorSteve Hancock <perltidy@users.sourceforge.net>
Sun, 23 Aug 2020 14:38:41 +0000 (07:38 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sun, 23 Aug 2020 14:38:41 +0000 (07:38 -0700)
t/snippets/expect/html2.def [new file with mode: 0644]
t/snippets/expect/html2.html [new file with mode: 0644]
t/snippets/html2.in [new file with mode: 0644]
t/snippets/packing_list.txt
t/snippets21.t

diff --git a/t/snippets/expect/html2.def b/t/snippets/expect/html2.def
new file mode 100644 (file)
index 0000000..714c191
--- /dev/null
@@ -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 (file)
index 0000000..4fc7391
--- /dev/null
@@ -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 (file)
index 0000000..31cfccc
--- /dev/null
@@ -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
+
index e29d1f17395848331801debbe00e2d3e69b8b5f3..1ea2f9cbf1d69efaa3783c179dce5329ef963107 100644 (file)
 ../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
 ../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
index 52e4d78cd1ec02ffbfd14db065713525ceaaab3d..9d4e00c4c03f6027d0a233c0a0bae7d99e15fbd9 100644 (file)
@@ -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};