4 # Author: David Goodger <goodger@python.org>
5 # Copyright: This module has been placed in the public domain.
11 from __init__
import DocutilsTestSupport
14 s
= DocutilsTestSupport
.ParserTestSuite()
15 s
.generateTests(totest
)
20 totest
['citations'] = [
22 .. [citation] This is a citation.
25 <document source="test data">
26 <citation ids="citation" names="citation">
33 .. [citation1234] This is a citation with year.
36 <document source="test data">
37 <citation ids="citation1234" names="citation1234">
41 This is a citation with year.
44 .. [citation] This is a citation
48 <document source="test data">
49 <citation ids="citation" names="citation">
57 .. [citation1] This is a citation
58 on multiple lines with more space.
60 .. [citation2] This is a citation
61 on multiple lines with less space.
64 <document source="test data">
65 <citation ids="citation1" names="citation1">
70 on multiple lines with more space.
71 <citation ids="citation2" names="citation2">
76 on multiple lines with less space.
80 This is a citation on multiple lines
81 whose block starts on line 2.
84 <document source="test data">
85 <citation ids="citation" names="citation">
89 This is a citation on multiple lines
90 whose block starts on line 2.
95 That was an empty citation.
98 <document source="test data">
99 <citation ids="citation" names="citation">
103 That was an empty citation.
110 <document source="test data">
111 <citation ids="citation" names="citation">
114 <system_message level="2" line="2" source="test data" type="WARNING">
116 Explicit markup ends without a blank line; unexpected unindent.
121 .. [citation label with spaces] this isn't a citation
123 .. [*citationlabelwithmarkup*] this isn't a citation
126 <document source="test data">
127 <comment xml:space="preserve">
128 [citation label with spaces] this isn't a citation
129 <comment xml:space="preserve">
130 [*citationlabelwithmarkup*] this isn't a citation
133 isolated internals : ``.-_``.
135 .. [citation.withdot] one dot
137 .. [citation-withdot] one hyphen
139 .. [citation_withunderscore] one underscore
141 .. [citation:with:colons] two colons
143 .. [citation+withplus] one plus
145 """<document source="test data">
147 isolated internals : \n\
151 <citation ids="citation-withdot" names="citation.withdot">
156 <citation ids="id1" names="citation-withdot">
161 <citation ids="citation-withunderscore" names="citation_withunderscore">
163 citation_withunderscore
166 <citation ids="citation-with-colons" names="citation:with:colons">
171 <citation ids="citation-withplus" names="citation+withplus">
180 if __name__
== '__main__':
182 unittest
.main(defaultTest
='suite')