diff options
author | Stefan Sauer <ensonic@users.sf.net> | 2019-02-26 08:59:49 +0100 |
---|---|---|
committer | Stefan Sauer <ensonic@users.sf.net> | 2019-02-26 08:59:49 +0100 |
commit | ce719faaea1484c40e2da02a5114a1d494fc3f2f (patch) | |
tree | 4bd0dc98398fdcf69ddbe06e36f3456834a07382 /tests | |
parent | 9629bb0f4df2876def2de902c2cfa8f4aa1a81f0 (diff) | |
download | gtk-doc-ce719faaea1484c40e2da02a5114a1d494fc3f2f.tar.gz |
mkhtml: add tests for refsection nav headers
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/mkhtml2.py | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/tests/mkhtml2.py b/tests/mkhtml2.py index d58f7ee..0512d08 100755 --- a/tests/mkhtml2.py +++ b/tests/mkhtml2.py @@ -267,7 +267,7 @@ class TestConverter(unittest.TestCase): </part>"""), xml_book_end]) - xml_book_chapter_refentry = '\n'.join([ + xml_book_chapter_refentry_beg = '\n'.join([ xml_book_beg, textwrap.dedent("""\ <chapter id="chap1"> @@ -275,10 +275,14 @@ class TestConverter(unittest.TestCase): <refentry id="GtkdocObject"> <refmeta> <refentrytitle role="top_of_page" id="GtkdocObject.top_of_page">GtkdocObject</refentrytitle> - </refmeta> + </refmeta>""")]) + + xml_book_chapter_refentry_end = '\n'.join([ + textwrap.dedent("""\ </refentry> </chapter>"""), xml_book_end]) + xml_book_chapter_refentry = '\n'.join([xml_book_chapter_refentry_beg, xml_book_chapter_refentry_end]) xml_book_index_empty = '\n'.join([ xml_book_beg, @@ -357,6 +361,30 @@ class TestConverter(unittest.TestCase): html = self.convert(self.xml_book, 0) self.assertIn('<title>test Reference Manual</title>', html) + def test_refnav_includes_normal_refsect1(self): + xml = '\n'.join([ + self.xml_book_chapter_refentry_beg, + textwrap.dedent("""\ + <refsect1 id="GtkdocObject.description" role="desc"> + <title role="desc.title">Description</title> + </refsect1> + """), + self.xml_book_chapter_refentry_end]) + html = self.convert(xml, 2) + self.assertIn('class="shortcut">Description</a>', html) + + def test_refnav_skips_protos_refsect1(self): + xml = '\n'.join([ + self.xml_book_chapter_refentry_beg, + textwrap.dedent("""\ + <refsect1 id="GtkdocObject.functions" role="functions_proto"> + <title role="functions_proto.title">Functions</title> + </refsect1> + """), + self.xml_book_chapter_refentry_end]) + html = self.convert(xml, 2) + self.assertNotIn('class="shortcut">Functions</a>', html) + if __name__ == '__main__': unittest.main() |