[gtk-doc] mhhtml2: add coverage for constants in devhelp generation



commit 04d3394d18598a7f6711e9ba53d151ea5b07392b
Author: Stefan Sauer <ensonic users sf net>
Date:   Fri Mar 8 08:13:13 2019 +0100

    mhhtml2: add coverage for constants in devhelp generation

 tests/mkhtml2.py | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
---
diff --git a/tests/mkhtml2.py b/tests/mkhtml2.py
index 00d3fd5..c61ee27 100755
--- a/tests/mkhtml2.py
+++ b/tests/mkhtml2.py
@@ -126,6 +126,7 @@ class TestDevhelp(unittest.TestCase):
         <chapter id="chap1"><title>Intro</title></chapter>
       </book>""")
 
+    # TODO: need one with multiple conditions
     xml_full = textwrap.dedent("""\
       <book>
         <bookinfo>
@@ -175,6 +176,47 @@ class TestDevhelp(unittest.TestCase):
                 </refsect3>
               </refsect2>
             </refsect1>
+            <refsect1 id="tester-GtkdocTypes.other_details" role="details">
+              <title role="details.title">Types and Values</title>
+              <refsect2 id="GtkdocEnum" role="enum">
+                <title>enum GtkdocEnum</title>
+                <indexterm zone="GtkdocEnum">
+                  <primary>GtkdocEnum</primary>
+                </indexterm>
+                <para>Enum values for the <link linkend="GtkdocEnum"><type>GtkdocEnum</type>
+                  </link> type.</para>
+                <refsect3 id="GtkdocEnum.members" role="enum_members">
+                  <title>Members</title>
+                  <informaltable role="enum_members_table" pgwide="1" frame="none">
+                    <tgroup cols="3">
+                      <colspec colname="enum_members_name" colwidth="300px"/>
+                      <colspec colname="enum_members_description"/>
+                      <colspec colname="enum_members_annotations" colwidth="200px"/>
+                      <tbody>
+                        <row role="constant">
+                          <entry role="enum_member_name">
+                            <para id="GTKDOC-ENUM-V1:CAPS">GTKDOC_ENUM_V1</para>
+                          </entry>
+                          <entry role="enum_member_description">
+                            <para>first</para>
+                          </entry>
+                          <entry role="enum_member_annotations"></entry>
+                        </row>
+                        <row role="constant">
+                          <entry role="enum_member_name">
+                            <para id="GTKDOC-ENUM-V2:CAPS">GTKDOC_ENUM_V2</para>
+                          </entry>
+                          <entry role="enum_member_description">
+                            <para>second Since: 0.5</para>
+                          </entry>
+                          <entry role="enum_member_annotations"></entry>
+                        </row>
+                      </tbody>
+                    </tgroup>
+                  </informaltable>
+                </refsect3>
+              </refsect2>
+            </refsect1>
           </refentry>
         </chapter>
       </book>""")
@@ -225,6 +267,13 @@ class TestDevhelp(unittest.TestCase):
             'link="GtkdocObject.html#GtkdocObjectClass.parent"/>',
             devhelp)
 
+    def test_create_devhelp_with_refesect3_has_constant_keywords(self):
+        devhelp = self.convert(self.xml_full)
+        self.assertIn(
+            '<keyword type="constant" name="GTKDOC_ENUM_V1" '
+            'link="GtkdocObject.html#GTKDOC-ENUM-V1:CAPS"/>',
+            devhelp)
+
 
 class TestNavNodes(unittest.TestCase):
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]