diff options
| author | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2005-02-26 18:20:45 +0000 |
|---|---|---|
| committer | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2005-02-26 18:20:45 +0000 |
| commit | 33527cb627160cc6709b2194da1df1fa6132b5f2 (patch) | |
| tree | 4cfadd3552b58ea3b856d6d2652472642096dfc0 /docutils/test/test_transforms | |
| parent | 8b6728d299e8eb0c463c88cf828e4c7a5679eb16 (diff) | |
| download | docutils-33527cb627160cc6709b2194da1df1fa6132b5f2.tar.gz | |
Fixed duplicate footnote label bug.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@2989 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test/test_transforms')
| -rwxr-xr-x | docutils/test/test_transforms/test_final_checks.py | 32 | ||||
| -rwxr-xr-x | docutils/test/test_transforms/test_footnotes.py | 25 |
2 files changed, 57 insertions, 0 deletions
diff --git a/docutils/test/test_transforms/test_final_checks.py b/docutils/test/test_transforms/test_final_checks.py index 220f666db..ee8d6a205 100755 --- a/docutils/test/test_transforms/test_final_checks.py +++ b/docutils/test/test_transforms/test_final_checks.py @@ -12,6 +12,7 @@ Tests for docutils.transforms.universal.FinalChecks. from __init__ import DocutilsTestSupport from docutils.transforms.universal import FinalChecks +from docutils.transforms.references import Footnotes from docutils.parsers.rst import Parser @@ -38,6 +39,37 @@ Unknown reference_. <paragraph> Unknown target name: "reference". """], +["""\ +Duplicate manual footnote labels, with reference ([1]_): + +.. [1] Footnote. + +.. [1] Footnote. +""", +"""\ +<document source="test data"> + <paragraph> + Duplicate manual footnote labels, with reference ( + <problematic id="id5" refid="id4"> + [1]_ + ): + <footnote dupname="1" id="id2"> + <label> + 1 + <paragraph> + Footnote. + <footnote dupname="1" id="id3"> + <label> + 1 + <system_message backrefs="id3" level="2" line="5" source="test data" type="WARNING"> + <paragraph> + Duplicate explicit target name: "1". + <paragraph> + Footnote. + <system_message backrefs="id5" id="id4" level="3" line="1" source="test data" type="ERROR"> + <paragraph> + Duplicate target name, cannot be used as a unique reference: "1". +"""], ]) diff --git a/docutils/test/test_transforms/test_footnotes.py b/docutils/test/test_transforms/test_footnotes.py index 0eddbfaf0..033f8fed0 100755 --- a/docutils/test/test_transforms/test_footnotes.py +++ b/docutils/test/test_transforms/test_footnotes.py @@ -512,6 +512,31 @@ u"""\ <paragraph> Auto-symbol footnote 12. """], +["""\ +Duplicate manual footnote labels: + +.. [1] Footnote. + +.. [1] Footnote. +""", +"""\ +<document source="test data"> + <paragraph> + Duplicate manual footnote labels: + <footnote dupname="1" id="id1"> + <label> + 1 + <paragraph> + Footnote. + <footnote dupname="1" id="id2"> + <label> + 1 + <system_message backrefs="id2" level="2" line="5" source="test data" type="WARNING"> + <paragraph> + Duplicate explicit target name: "1". + <paragraph> + Footnote. +"""], ]) |
