Skip to content

[HTML search] Test suite: ranking check should ensure that all entries are found. #12607

@jayaddison

Description

@jayaddison

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/A

Additional context

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions