5
:Contact: goodger@users.sourceforge.net
6
:Revision: $Revision: 1.4 $
7
:Date: $Date: 2002/06/27 01:26:44 $
8
:Copyright: This module has been placed in the public domain.
13
from __init__ import DocutilsTestSupport
16
s = DocutilsTestSupport.ParserTestSuite()
17
s.generateTests(totest)
26
(Internal hyperlink target.)
30
<target id="target" name="target">
32
(Internal hyperlink target.)
35
External hyperlink targets:
37
.. _one-liner: http://structuredtext.sourceforge.net
39
.. _starts-on-this-line: http://
44
http://structuredtext.
47
.. _not-indirect: uri\_
52
External hyperlink targets:
53
<target id="one-liner" name="one-liner" refuri="http://structuredtext.sourceforge.net">
54
<target id="starts-on-this-line" name="starts-on-this-line" refuri="http://structuredtext.sourceforge.net">
55
<target id="entirely-below" name="entirely-below" refuri="http://structuredtext.sourceforge.net">
56
<target id="not-indirect" name="not-indirect" refuri="uri_">
59
Indirect hyperlink targets:
61
.. _target1: reference_
63
.. _target2: `phrase-link reference`_
68
Indirect hyperlink targets:
69
<target id="target1" name="target1" refname="reference">
70
<target id="target2" name="target2" refname="phrase-link reference">
73
.. _target1: Not a proper hyperlink target
75
.. _target2: Although it ends with an underscore, this is not a phrase-link_
77
.. _target3: A multi-line verson of something
78
ending with an underscore, but not a phrase-link_
82
<system_message level="2" type="WARNING">
84
Hyperlink target at line 1 contains whitespace. Perhaps a footnote was intended?
86
.. _target1: Not a proper hyperlink target
87
<system_message level="2" type="WARNING">
89
Hyperlink target at line 3 contains whitespace. Perhaps a footnote was intended?
91
.. _target2: Although it ends with an underscore, this is not a phrase-link_
92
<system_message level="2" type="WARNING">
94
Hyperlink target at line 5 contains whitespace. Perhaps a footnote was intended?
96
.. _target3: A multi-line verson of something
97
ending with an underscore, but not a phrase-link_
100
.. __: Not a proper hyperlink target
102
__ Although it ends with an underscore, this is not a phrase-link_
104
__ A multi-line verson of something
105
ending with an underscore, but not a phrase-link_
109
<system_message level="2" type="WARNING">
111
Hyperlink target at line 1 contains whitespace. Perhaps a footnote was intended?
113
.. __: Not a proper hyperlink target
114
<system_message level="2" type="WARNING">
116
Anonymous hyperlink target at line 3 contains whitespace. Perhaps a footnote was intended?
118
__ Although it ends with an underscore, this is not a phrase-link_
119
<system_message level="2" type="WARNING">
121
Anonymous hyperlink target at line 5 contains whitespace. Perhaps a footnote was intended?
123
__ A multi-line verson of something
124
ending with an underscore, but not a phrase-link_
127
.. _a long target name:
129
.. _`a target name: including a colon (quoted)`:
131
.. _a target name\: including a colon (escaped):
135
<target id="a-long-target-name" name="a long target name">
136
<target id="a-target-name-including-a-colon-quoted" name="a target name: including a colon (quoted)">
137
<target id="a-target-name-including-a-colon-escaped" name="a target name: including a colon (escaped)">
140
.. _a very long target name,
147
<target id="a-very-long-target-name-split-across-lines" name="a very long target name, split across lines">
148
<target id="and-another-with-backquotes" name="and another, with backquotes">
153
.. _target: http://www.python.org/
159
<target id="target" name="target" refuri="http://www.python.org/">
162
Duplicate external targets (different URIs):
171
Duplicate external targets (different URIs):
172
<target dupname="target" id="target" refuri="first">
173
<system_message backrefs="id1" level="2" type="WARNING">
175
Duplicate explicit target name: "target".
176
<target dupname="target" id="id1" refuri="second">
179
Duplicate external targets (same URIs):
188
Duplicate external targets (same URIs):
189
<target id="target" name="target" refuri="first">
190
<system_message backrefs="id1" level="1" type="INFO">
192
Duplicate explicit target name: "target".
193
<target dupname="target" id="id1" refuri="first">
196
Duplicate implicit targets.
211
Duplicate implicit targets.
212
<section dupname="title" id="title">
217
<section dupname="title" id="id1">
220
<system_message backrefs="id1" level="1" type="INFO">
222
Duplicate implicit target name: "title".
227
Duplicate implicit/explicit targets.
239
Duplicate implicit/explicit targets.
240
<section dupname="title" id="title">
243
<system_message backrefs="id1" level="1" type="INFO">
245
Duplicate implicit target name: "title".
246
<target id="id1" name="title">
251
Duplicate explicit targets.
268
Duplicate explicit targets.
269
<target dupname="title" id="title">
272
<system_message backrefs="id1" level="2" type="WARNING">
274
Duplicate explicit target name: "title".
275
<target dupname="title" id="id1">
278
<system_message backrefs="id2" level="2" type="WARNING">
280
Duplicate explicit target name: "title".
281
<target dupname="title" id="id2">
291
Implicit section header target.
293
.. [target] Citation target.
295
.. [#target] Autonumber-labeled footnote target.
299
Explicit internal target.
301
.. _target: Explicit_external_target
307
<section dupname="target" id="target">
311
Implicit section header target.
312
<citation dupname="target" id="id1">
315
<system_message backrefs="id1" level="1" type="INFO">
317
Duplicate implicit target name: "target".
320
<footnote auto="1" dupname="target" id="id2">
321
<system_message backrefs="id2" level="2" type="WARNING">
323
Duplicate explicit target name: "target".
325
Autonumber-labeled footnote target.
326
<system_message backrefs="id3" level="2" type="WARNING">
328
Duplicate explicit target name: "target".
329
<target dupname="target" id="id3">
331
Explicit internal target.
332
<system_message backrefs="id4" level="2" type="WARNING">
334
Duplicate explicit target name: "target".
335
<target dupname="target" id="id4" refuri="Explicit_external_target">
339
totest['anonymous_targets'] = [
341
Anonymous external hyperlink target:
343
.. __: http://w3c.org/
348
Anonymous external hyperlink target:
349
<target anonymous="1" id="id1" refuri="http://w3c.org/">
352
Anonymous external hyperlink target:
359
Anonymous external hyperlink target:
360
<target anonymous="1" id="id1" refuri="http://w3c.org/">
363
Anonymous indirect hyperlink target:
370
Anonymous indirect hyperlink target:
371
<target anonymous="1" id="id1" refname="reference">
374
Anonymous indirect hyperlink targets:
383
Anonymous indirect hyperlink targets:
384
<target anonymous="1" id="id1" refname="reference">
385
<target anonymous="1" id="id2" refname="a very long reference">
388
Mixed anonymous & named indirect hyperlink targets:
393
.. _target1: reference_
396
.. _target2: reference_
405
Mixed anonymous & named indirect hyperlink targets:
406
<target anonymous="1" id="id1" refname="reference">
407
<target anonymous="1" id="id2" refname="reference">
408
<target anonymous="1" id="id3" refname="reference">
409
<target id="target1" name="target1" refname="reference">
410
<system_message level="2" type="WARNING">
412
Explicit markup ends without a blank line; unexpected unindent at line 7.
415
<target id="target2" name="target2" refname="reference">
416
<target anonymous="1" id="id4" refname="reference">
417
<target anonymous="1" id="id5" refname="reference">
418
<target anonymous="1" id="id6" refname="reference">
419
<system_message level="2" type="WARNING">
421
Explicit markup ends without a blank line; unexpected unindent at line 13.
427
if __name__ == '__main__':
429
unittest.main(defaultTest='suite')