diff options
author | Jakob Lykke Andersen <Jakob@caput.dk> | 2021-11-06 16:02:37 +0300 |
---|---|---|
committer | Jakob Lykke Andersen <Jakob@caput.dk> | 2022-01-16 11:48:06 +0300 |
commit | 029d0e5b1837de4e33ee92cbb88d650e9afb8a3d (patch) | |
tree | 9679b10175ee3dfd5bac87eab743b4d818e95b11 /tests | |
parent | ce5512e3afc5d4a4af084aef8f622b01ffee5c2b (diff) |
intersphinx role: new inventory parsing from role name
Diffstat (limited to 'tests')
-rw-r--r-- | tests/roots/test-ext-intersphinx-role/index.rst | 25 | ||||
-rw-r--r-- | tests/test_ext_intersphinx.py | 17 |
2 files changed, 41 insertions, 1 deletions
diff --git a/tests/roots/test-ext-intersphinx-role/index.rst b/tests/roots/test-ext-intersphinx-role/index.rst index bb7a6c4f1..5c2cdbd00 100644 --- a/tests/roots/test-ext-intersphinx-role/index.rst +++ b/tests/roots/test-ext-intersphinx-role/index.rst @@ -14,8 +14,31 @@ - ``module10`` is only defined here, but should still not be resolved to: :external:py:mod:`module10` - - a function in inv: :external:py:func:`module1.func` - a method, but with old style inventory prefix, which shouldn't work: :external:py:meth:`inv:Foo.bar` +- a non-existing role: + :external:py:nope:`something` + +.. default-domain:: cpp + +- a type where the default domain is used to find the role: + :external:type:`std::uint8_t` +- a non-existing role in default domain: + :external:nope:`somethingElse` + +- two roles in ``std`` which can be found without a default domain: + + - :external:doc:`docname` + - :external:option:`ls -l` + + +- a function with explicit inventory: + :external:inv+c:func:`CFunc` +- a class with explicit non-existing inventory, which also has upper-case in name: + :external:invNope+cpp:class:`foo::Bar` + + +- explicit title: + :external:cpp:type:`FoonsTitle <foons>` diff --git a/tests/test_ext_intersphinx.py b/tests/test_ext_intersphinx.py index ec2aad440..11450e2c3 100644 --- a/tests/test_ext_intersphinx.py +++ b/tests/test_ext_intersphinx.py @@ -552,3 +552,20 @@ def test_intersphinx_role(app, warning): assert html.format('sub/foo.html#module1.func') in content assert "WARNING: external py:meth reference target not found: inv:Foo.bar" in wStr + + assert "WARNING: role for external cross-reference not found: py:nope" in wStr + + # default domain + assert html.format('index.html#std_uint8_t') in content + assert "WARNING: role for external cross-reference not found: nope" in wStr + + # std roles without domain prefix + assert html.format('docname.html') in content + assert html.format('index.html#cmdoption-ls-l') in content + + # explicit inventory + assert html.format('cfunc.html#CFunc') in content + #assert "WARNING: inventory for external cross-reference not found: invNope" in wStr + + # explicit title + assert html.format('index.html#foons') in content |