3 # Author: Jon Waltman <jonathan.waltman@gmail.com>
4 # Copyright: This module has been placed in the public domain.
7 Tests for Texinfo writer.
16 sys
.path
.insert(0, os
.path
.abspath('../../docutils/test'))
17 import DocutilsTestSupport
21 s
= DocutilsTestSupport
.PublishTestSuite('texinfo', suite_settings
=settings
)
22 s
.generateTests(totest
)
25 template
= texinfo
.TEMPLATE
28 filename
='<string>.info',
43 template
% dict(parts
)],
47 totest
['escaping'] = [
53 @commands{ use braces }.
63 template
% dict(parts
,
66 r
"""@@commands@{ use braces @}.
68 @@ @{ @} @@@@ @{@{ @}@}
78 totest
['table_with_markup'] = [
81 +------------+---------------------+--------------------+
82 | emphasis | strong emphasis | inline literal |
83 +============+=====================+====================+
84 | *emphasis* | **strong emphasis** | ``inline literal`` |
85 +------------+---------------------+--------------------+
88 template
% dict(parts
,
90 r
"""@multitable {xxxxxxxxxxxxxx} {xxxxxxxxxxxxxxxxxxxxxxx} {xxxxxxxxxxxxxxxxxxxxxx}
95 @tab @strong{strong emphasis}
96 @tab @code{inline literal}
101 totest
['sections'] = [
107 This tests sectioning.
123 template
% dict(parts
,
126 r
"""This tests sectioning.
134 --- The Detailed Node Listing ---
143 @node Section 1,Section 2,Top,Top
144 @anchor{section 1}@anchor{0}@anchor{section-1}
152 @node SubSection 1 1,,,Section 1
153 @anchor{subsection 1 1}@anchor{1}@anchor{subsection-1-1}
154 @section SubSection 1.1
157 * SubSubSection 1 1 1::
161 @node SubSubSection 1 1 1,,,SubSection 1 1
162 @anchor{subsubsection 1 1 1}@anchor{2}@anchor{subsubsection-1-1-1}
163 @subsection SubSubSection 1.1.1
165 @node Section 2,,Section 1,Top
166 @anchor{section 2}@anchor{3}@anchor{section-2}
171 totest
['duplicate_sections'] = [
185 template
% dict(parts
,
189 * Duplicate: Duplicate<2>.
190 * Duplicate: Duplicate<3>.
194 @node Duplicate<2>,Duplicate<3>,Top,Top
195 @anchor{duplicate<2>}@anchor{0}@anchor{1}@anchor{id1}
196 @unnumbered Duplicate
198 @node Duplicate<3>,,Duplicate<2>,Top
199 @anchor{duplicate<3>}@anchor{2}@anchor{id2}
200 @unnumbered Duplicate
205 totest
['comments'] = [
213 template
% dict(parts
,
220 totest
['docinfo'] = [
227 :Copyright: This document has been placed in the public domain.
232 template
% dict(parts
,
233 title
='Doc Info Test',
240 This document has been placed in the public domain.
248 totest
['admonitions'] = [
260 template
% dict(parts
,
272 if __name__
== '__main__':
274 unittest
.main(defaultTest
='suite')