summaryrefslogtreecommitdiff
path: root/tests/test_domain_cpp.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2022-03-19 22:58:15 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2022-03-19 22:58:15 +0900
commitaa1bc83c2ac9357b39048b555c3fdb0efff3449c (patch)
treec1149670ca18b5f9820505322d5b0a5832395ea4 /tests/test_domain_cpp.py
parent759a526b12213c59d6ae4c8f66682f4328b764f4 (diff)
parent017ef6118b4fe588140266ad6ff2393cbddd9137 (diff)
downloadsphinx-git-aa1bc83c2ac9357b39048b555c3fdb0efff3449c.tar.gz
Merge branch '4.x'
Diffstat (limited to 'tests/test_domain_cpp.py')
-rw-r--r--tests/test_domain_cpp.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/test_domain_cpp.py b/tests/test_domain_cpp.py
index 8fc974f49..72ffc474d 100644
--- a/tests/test_domain_cpp.py
+++ b/tests/test_domain_cpp.py
@@ -1,12 +1,4 @@
-"""
- test_domain_cpp
- ~~~~~~~~~~~~~~~
-
- Tests the C++ Domain
-
- :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
+"""Tests the C++ Domain"""
import itertools
import re
@@ -996,6 +988,11 @@ def test_domain_cpp_ast_attributes():
# position: parameters and qualifiers
check('function', 'void f() [[attr1]] [[attr2]]', {1: 'f', 2: '1fv'})
+ # position: class, union, enum
+ check('class', '{key}[[nodiscard]] Foo', {1: 'Foo', 2: '3Foo'}, key='class')
+ check('union', '{key}[[nodiscard]] Foo', {1: None, 2: '3Foo'}, key='union')
+ check('enum', '{key}[[nodiscard]] Foo', {1: None, 2: '3Foo'}, key='enum')
+
def test_domain_cpp_ast_xref_parsing():
def check(target):