summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorwiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2006-01-22 22:53:32 +0000
committerwiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2006-01-22 22:53:32 +0000
commit13606b3f350601d2f98338cd022bfeecbd341219 (patch)
tree4b00b3b384d5fa03a5a0da71be698dedb5671c66 /test
parent0e3fedb7735d57262cdf05e0b3995434afcdebe5 (diff)
downloaddocutils-13606b3f350601d2f98338cd022bfeecbd341219.tar.gz
--- MERGE: merged r4315 to maintenance branch; original log message:
fixed "target beginning with underscore" bug; added test for missing closing backquote in targets git-svn-id: http://svn.code.sf.net/p/docutils/code/branches/docutils-0.4@4318 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_parsers/test_rst/test_targets.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/test_parsers/test_rst/test_targets.py b/test/test_parsers/test_rst/test_targets.py
index 362bf2cca..095974570 100755
--- a/test/test_parsers/test_rst/test_targets.py
+++ b/test/test_parsers/test_rst/test_targets.py
@@ -90,6 +90,23 @@ Indirect hyperlink targets:
<target ids="a-target-name-including-a-colon-escaped" names="a\ target\ name:\ including\ a\ colon\ (escaped)">
"""],
["""\
+.. _`target: No matching backquote.
+.. _`: No matching backquote either.
+""",
+"""\
+<document source="test data">
+ <comment xml:space="preserve">
+ _`target: No matching backquote.
+ <system_message level="2" line="1" source="test data" type="WARNING">
+ <paragraph>
+ malformed hyperlink target.
+ <comment xml:space="preserve">
+ _`: No matching backquote either.
+ <system_message level="2" line="2" source="test data" type="WARNING">
+ <paragraph>
+ malformed hyperlink target.
+"""],
+["""\
.. _a very long target name,
split across lines:
.. _`and another,
@@ -123,6 +140,28 @@ External hyperlink:
<target ids="multi-line-email" names="multi-line\ email" refuri="mailto:jdoe@example.com">
"""],
["""\
+Malformed target:
+
+.. __malformed: no good
+
+Target beginning with an underscore:
+
+.. _`_target`: OK
+""",
+"""\
+<document source="test data">
+ <paragraph>
+ Malformed target:
+ <comment xml:space="preserve">
+ __malformed: no good
+ <system_message level="2" line="3" source="test data" type="WARNING">
+ <paragraph>
+ malformed hyperlink target.
+ <paragraph>
+ Target beginning with an underscore:
+ <target ids="target" names="_target" refuri="OK">
+"""],
+["""\
Duplicate external targets (different URIs):
.. _target: first