diff options
| author | Jakob Lykke Andersen <Jakob@caput.dk> | 2020-07-04 20:16:04 +0200 |
|---|---|---|
| committer | Jakob Lykke Andersen <Jakob@caput.dk> | 2020-07-05 09:17:20 +0200 |
| commit | 18b3e3c450670900549210e53215977b7c415d83 (patch) | |
| tree | cfcec25807908cd12b548db1bc15c561c6edeb93 /tests/test_domain_cpp.py | |
| parent | c668500a4b37e5cf3c7015bda8a558ededbcebfe (diff) | |
| download | sphinx-git-18b3e3c450670900549210e53215977b7c415d83.tar.gz | |
Add tests for noindexentry
Diffstat (limited to 'tests/test_domain_cpp.py')
| -rw-r--r-- | tests/test_domain_cpp.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_domain_cpp.py b/tests/test_domain_cpp.py index a6c9eee9d..28e437219 100644 --- a/tests/test_domain_cpp.py +++ b/tests/test_domain_cpp.py @@ -14,8 +14,11 @@ import pytest import sphinx.domains.cpp as cppDomain from sphinx import addnodes +from sphinx.addnodes import desc from sphinx.domains.cpp import DefinitionParser, DefinitionError, NoOldIdError from sphinx.domains.cpp import Symbol, _max_id, _id_prefix +from sphinx.testing import restructuredtext +from sphinx.testing.util import assert_node from sphinx.util import docutils @@ -1211,3 +1214,13 @@ not found in `{test}` assert any_role.classes == cpp_any_role.classes, expect assert any_role.classes == expr_role.content_classes['a'], expect assert any_role.classes == texpr_role.content_classes['a'], expect + + +def test_noindexentry(app): + text = (".. cpp:function:: void f()\n" + ".. cpp:function:: void g()\n" + " :noindexentry:\n") + doctree = restructuredtext.parse(app, text) + assert_node(doctree, (addnodes.index, desc, addnodes.index, desc)) + assert_node(doctree[0], addnodes.index, entries=[('single', 'f (C++ function)', '_CPPv41fv', '', None)]) + assert_node(doctree[2], addnodes.index, entries=[]) |
