Skip to content

Commit e79656d

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

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_domain_std.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,20 @@ def test_productionlist(app, status, warning):
404404
text = (app.outdir / 'LineContinuation.html').read_text()
405405
assert "A</strong> ::= B C D E F G" in text
406406

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

408422
def test_disabled_docref(app):
409423
text = (":doc:`index`\n"

0 commit comments

Comments
 (0)