-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Describe the bug
The checkRanking function in our test suite has a bug; it's currently possible for the final item in the expected ranking list not to be found in the result-set, and yet for the function to pass.
Expected Behaviour
The checkRanking function should confirm that all of the items specified in the expectedRanking argument appear within the results argument, and in the list-iteration-order provided. If they do not, then an assertion error should be raised, failing the test.
Actual Behaviour
If all items up until the final entry in the expectedRanking argument are found in the expected order, but the final entry itself is not found at all in the results, then no assertion error is raised, and the test passes.
How to Reproduce
The score a main-title match above an object member match JavaScript test case passes currently -- but it should fail, because the anchor target is incorrect.
The test should fail with the incorrect anchor. The correct anchor target (a class attribute) is #relevance.Example.relevance.
Environment Information
Platform: linux; (Linux-6.9.8-arm64-aarch64-with-glibc2.38)
Python version: 3.12.4 (main, Jun 12 2024, 19:06:53) [GCC 13.2.0])
Python implementation: CPython
Sphinx version: 7.4.5
Docutils version: 0.21.2
Jinja2 version: 3.1.4
Pygments version: 2.18.0
Sphinx extensions
N/AAdditional context
- This is a bug in some test framework code that I introduced in Improve relevance scoring for titles and object-name matches in search results #12441.
- The bug was discovered while preparing an implementation to fix [HTML search] Optimization: write zero/one instead (one character) instead of true/false (four/five characters) for bool flags. #12605.
- The bug affects the Sphinx test suite, but not the Sphinx application code.