mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #7064 from tk0miya/7025_nosearch
Close #7025: html search: full text search can be disabled via metadata
This commit is contained in:
7
tests/roots/test-search/nosearch.rst
Normal file
7
tests/roots/test-search/nosearch.rst
Normal file
@@ -0,0 +1,7 @@
|
||||
:nosearch:
|
||||
|
||||
nosearch
|
||||
========
|
||||
|
||||
zfs
|
||||
latex
|
||||
@@ -116,7 +116,7 @@ def test_term_in_heading_and_section(app, status, warning):
|
||||
# if search term is in the title of one doc and in the text of another
|
||||
# both documents should be a hit in the search index as a title,
|
||||
# respectively text hit
|
||||
assert 'textinhead:1' in searchindex
|
||||
assert 'textinhead:2' in searchindex
|
||||
assert 'textinhead:0' in searchindex
|
||||
|
||||
|
||||
@@ -252,3 +252,13 @@ def test_search_index_gen_zh(app, status, warning):
|
||||
assert 'chinesetest' in searchindex
|
||||
assert 'chinesetesttwo' in searchindex
|
||||
assert 'cas' in searchindex
|
||||
|
||||
|
||||
@pytest.mark.sphinx(testroot='search')
|
||||
def test_nosearch(app):
|
||||
app.build()
|
||||
index = jsload(app.outdir / 'searchindex.js')
|
||||
assert index['docnames'] == ['index', 'nosearch', 'tocitem']
|
||||
assert 'latex' not in index['terms']
|
||||
assert 'zfs' in index['terms']
|
||||
assert index['terms']['zfs'] == 0 # zfs on nosearch.rst is not registered to index
|
||||
|
||||
Reference in New Issue
Block a user