Add tests for `:manpage:` inside a title (#11705)

This commit is contained in:
Bénédikt Tran 2024-02-14 10:33:09 +01:00 committed by GitHub
parent b587eb243a
commit 08386826fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 5 deletions

View File

@ -1,5 +1,7 @@
* :manpage:`man(1)`
* :manpage:`ls.1`
* :manpage:`sphinx`
* :manpage:`mailx(1) <bsd-mailx/mailx.1>`
* :manpage:`!man(1)`
The :manpage:`cp(1)`
--------------------
* :manpage:`man(1)`
* :manpage:`ls.1`
* :manpage:`sphinx`
* :manpage:`mailx(1) <bsd-mailx/mailx.1>`
* :manpage:`!man(1)`

View File

@ -293,6 +293,20 @@ def test_html_sidebar(app, status, warning):
assert ctx['sidebars'] == []
@pytest.mark.parametrize(("fname", "expect"), [
('index.html', (".//h1/em/a[@href='https://example.com/cp.1']", '', True)),
('index.html', (".//em/a[@href='https://example.com/man.1']", '', True)),
('index.html', (".//em/a[@href='https://example.com/ls.1']", '', True)),
('index.html', (".//em/a[@href='https://example.com/sphinx.']", '', True)),
])
@pytest.mark.sphinx('html', testroot='manpage_url', confoverrides={
'manpages_url': 'https://example.com/{page}.{section}'})
@pytest.mark.test_params(shared_result='test_build_html_manpage_url')
def test_html_manpage(app, cached_etree_parse, fname, expect):
app.build()
check_xpath(cached_etree_parse(app.outdir / fname), fname, *expect)
@pytest.mark.sphinx('html', testroot='toctree-glob',
confoverrides={'html_baseurl': 'https://example.com/'})
def test_html_baseurl(app, status, warning):