diff options
author | Jan Babst <jan.babst@live.de> | 2020-04-18 00:26:10 +0200 |
---|---|---|
committer | Jakob Lykke Andersen <Jakob@caput.dk> | 2020-04-24 10:45:23 +0200 |
commit | 50ae1b04e8bc6249a3b1537b88aa7769d8533dba (patch) | |
tree | d24a3d1e7b533eba9cd94fa5b813ac051e3f07c3 /tests/test_domain_cpp.py | |
parent | d68aa335c4b7c29f7fe18cf99a1533a2d8c18183 (diff) | |
download | sphinx-git-50ae1b04e8bc6249a3b1537b88aa7769d8533dba.tar.gz |
C++ domain: Add support for semicolon in declarations
Diffstat (limited to 'tests/test_domain_cpp.py')
-rw-r--r-- | tests/test_domain_cpp.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/test_domain_cpp.py b/tests/test_domain_cpp.py index 0b757139a..ae3e1fa1e 100644 --- a/tests/test_domain_cpp.py +++ b/tests/test_domain_cpp.py @@ -33,10 +33,8 @@ def parse(name, string): return ast -def check(name, input, idDict, output=None): +def _check(name, input, idDict, output): # first a simple check of the AST - if output is None: - output = input ast = parse(name, input) res = str(ast) if res != output: @@ -83,6 +81,15 @@ def check(name, input, idDict, output=None): raise DefinitionError("") +def check(name, input, idDict, output=None): + if output is None: + output = input + # First, check without semicolon + _check(name, input, idDict, output) + # Second, check with semicolon + _check(name, input + ';', idDict, output + ';') + + def test_fundamental_types(): # see https://en.cppreference.com/w/cpp/language/types for t, id_v2 in cppDomain._id_fundamental_v2.items(): |