diff options
author | Armin Ronacher <armin.ronacher@active-4.com> | 2011-09-23 00:51:43 +0200 |
---|---|---|
committer | Armin Ronacher <armin.ronacher@active-4.com> | 2011-09-23 00:51:43 +0200 |
commit | f6711a62090beae8158501a6b7a3e68d821ffc72 (patch) | |
tree | 29025de42f0225d8f08c301e7988c58a38392996 /tests/test_cpp_domain.py | |
parent | 2a021f1cf9a73d7e4cef78cd1dbf5a4a0f2bd2f3 (diff) | |
download | sphinx-git-f6711a62090beae8158501a6b7a3e68d821ffc72.tar.gz |
Added more tests to the basic parsing of C++ signatures
Diffstat (limited to 'tests/test_cpp_domain.py')
-rw-r--r-- | tests/test_cpp_domain.py | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/tests/test_cpp_domain.py b/tests/test_cpp_domain.py index 30cdb69e7..22e24a08b 100644 --- a/tests/test_cpp_domain.py +++ b/tests/test_cpp_domain.py @@ -25,11 +25,8 @@ def test_type_definitions(): rv = parse('member_object', ' const std::string & name leftover') assert unicode(rv) == 'const std::string& name' - x = 'void operator()(const boost::array<VertexID, 2>& v) const' - assert unicode(parse('function', x)) == x - - x = 'void operator()(const boost::array<VertexID, 2, "foo, bar">& v) const' - assert unicode(parse('function', x)) == x + rv = parse('member_object', ' const std::string & name [n] leftover') + assert unicode(rv) == 'const std::string& name[n]' rv = parse('member_object', 'const std::vector< unsigned int, long> &name') assert unicode(rv) == 'const std::vector<unsigned int, long>& name' @@ -51,6 +48,12 @@ def test_type_definitions(): assert unicode(parse('type_object', 'long long int foo')) == 'long long foo' + x = 'void operator()(const boost::array<VertexID, 2>& v) const' + assert unicode(parse('function', x)) == x + + x = 'void operator()(const boost::array<VertexID, 2, "foo, bar">& v) const' + assert unicode(parse('function', x)) == x + x = 'MyClass::MyClass(MyClass::MyClass&&)' assert unicode(parse('function', x)) == x @@ -60,6 +63,16 @@ def test_type_definitions(): x = 'int get_value() const noexcept' assert unicode(parse('function', x)) == x + x = 'int main(int argc, char* argv[][])' + assert unicode(parse('function', x)) == x + + x = 'std::vector<std::pair<std::string, int>>& module::test(register ' \ + 'foo, bar[n], std::string baz="foobar, blah, bleh") const = 0' + assert unicode(parse('function', x)) == x + + x = 'module::myclass foo[n]' + assert unicode(parse('member_object', x)) == x + def test_operators(): x = parse('function', 'void operator new [ ] ()') |