diff options
author | Jonathan Waltman <jonathan.waltman@gmail.com> | 2012-11-10 23:37:42 -0600 |
---|---|---|
committer | Jonathan Waltman <jonathan.waltman@gmail.com> | 2012-11-10 23:37:42 -0600 |
commit | c134b218b743206697ce1843b2a529d7ec526d41 (patch) | |
tree | ea40dfaab5c82390ec795f8ca5fb547039ff4c49 /tests/test_cpp_domain.py | |
parent | eabcf7883ee0b4ea9b1f2da320581a3e454bf692 (diff) | |
download | sphinx-git-c134b218b743206697ce1843b2a529d7ec526d41.tar.gz |
Closes #681: Allow nested parentheses in C++ signatures (patch by Vadim and Jim Naslund)
Diffstat (limited to 'tests/test_cpp_domain.py')
-rw-r--r-- | tests/test_cpp_domain.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/test_cpp_domain.py b/tests/test_cpp_domain.py index 3ab8ece4c..bd8aafa76 100644 --- a/tests/test_cpp_domain.py +++ b/tests/test_cpp_domain.py @@ -11,7 +11,7 @@ from util import * -from sphinx.domains.cpp import DefinitionParser +from sphinx.domains.cpp import DefinitionParser, DefinitionError def parse(name, string): @@ -73,6 +73,21 @@ def test_type_definitions(): x = 'module::myclass foo[n]' assert unicode(parse('member_object', x)) == x + x = 'int foo(Foo f=Foo(double(), std::make_pair(int(2), double(3.4))))' + assert unicode(parse('function', x)) == x + + x = 'int foo(A a=x(a))' + assert unicode(parse('function', x)) == x + + x = 'int foo(B b=x(a)' + raises(DefinitionError, parse, 'function', x) + + x = 'int foo)C c=x(a))' + raises(DefinitionError, parse, 'function', x) + + x = 'int foo(D d=x(a' + raises(DefinitionError, parse, 'function', x) + def test_bases(): x = 'A' |