Skip to content

Commit

Permalink
Add testcase.
Browse files Browse the repository at this point in the history
  • Loading branch information
silene committed Jan 23, 2021
1 parent 8a1d0d0 commit e79656d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_domain_std.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,20 @@ def test_productionlist(app, status, warning):
text = (app.outdir / 'LineContinuation.html').read_text()
assert "A</strong> ::= B C D E F G" in text

def test_productionlist2(app):
text = (".. productionlist:: P2\n"
" A: `:A` `A`\n"
" B: `P1:B` `~P1:B`\n")
doctree = restructuredtext.parse(app, text)
refnodes = list(doctree.traverse(pending_xref))
assert_node(refnodes[0], pending_xref, reftarget="A")
assert_node(refnodes[1], pending_xref, reftarget="P2:A")
assert_node(refnodes[2], pending_xref, reftarget="P1:B")
assert_node(refnodes[3], pending_xref, reftarget="P1:B")
assert_node(refnodes[0], [pending_xref, nodes.literal, "A"])
assert_node(refnodes[1], [pending_xref, nodes.literal, "A"])
assert_node(refnodes[2], [pending_xref, nodes.literal, "P1:B"])
assert_node(refnodes[3], [pending_xref, nodes.literal, "B"])

def test_disabled_docref(app):
text = (":doc:`index`\n"
Expand Down

0 comments on commit e79656d

Please sign in to comment.