mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add basic syntax test for index :name:
This commit is contained in:
@@ -126,3 +126,14 @@ def test_create_index_by_key(app):
|
||||
assert index[0] == ('D', [('docutils', [[('main', '#term-docutils')], [], None])])
|
||||
assert index[1] == ('P', [('Python', [[('main', '#term-python')], [], None])])
|
||||
assert index[2] == ('ス', [('スフィンクス', [[('main', '#term-0')], [], 'ス'])])
|
||||
|
||||
|
||||
@pytest.mark.sphinx('dummy', freshenv=True)
|
||||
def test_create_index_with_name(app):
|
||||
text = (".. index:: single: docutils\n :name: ref1\n"
|
||||
".. index:: see: Python; interpreter\n :name: ref2\n")
|
||||
restructuredtext.parse(app, text)
|
||||
index = IndexEntries(app.env).create_index(app.builder)
|
||||
assert len(index) == 2
|
||||
assert index[0] == ('D', [('docutils', [[('', '#index-0')], [], None])])
|
||||
assert index[1] == ('P', [('Python', [[], [('see interpreter', [])], None])])
|
||||
|
||||
Reference in New Issue
Block a user