Skip to content

Commit ffacb2c

Browse files
committed
Add testcase.
1 parent 8a1d0d0 commit ffacb2c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_domain_std.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,22 @@ def test_productionlist(app, status, warning):
405405
assert "A</strong> ::= B C D E F G" in text
406406

407407

408+
def test_productionlist2(app):
409+
text = (".. productionlist:: P2\n"
410+
" A: `:A` `A`\n"
411+
" B: `P1:B` `~P1:B`\n")
412+
doctree = restructuredtext.parse(app, text)
413+
refnodes = list(doctree.traverse(pending_xref))
414+
assert_node(refnodes[0], pending_xref, reftarget="A")
415+
assert_node(refnodes[1], pending_xref, reftarget="P2:A")
416+
assert_node(refnodes[2], pending_xref, reftarget="P1:B")
417+
assert_node(refnodes[3], pending_xref, reftarget="P1:B")
418+
assert_node(refnodes[0], [pending_xref, nodes.literal, "A"])
419+
assert_node(refnodes[1], [pending_xref, nodes.literal, "A"])
420+
assert_node(refnodes[2], [pending_xref, nodes.literal, "P1:B"])
421+
assert_node(refnodes[3], [pending_xref, nodes.literal, "B"])
422+
423+
408424
def test_disabled_docref(app):
409425
text = (":doc:`index`\n"
410426
":doc:`!index`\n")

0 commit comments

Comments
 (0)