Skip to content

Commit

Permalink
[tests] search: re-constrain cpp and partial test cases to term-searc…
Browse files Browse the repository at this point in the history
…h-only.

Follows-on-from commit 7370d20.
  • Loading branch information
jayaddison committed Apr 4, 2024
1 parent 9b709d7 commit 3d108c1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/js/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ describe('Basic html theme search', function() {
it('should find "C++" when in index', function() {
eval(loadFixture("cpp/searchindex.js"));

searchParameters = Search._parseQuery('C++');
searchterms = ['c++'];
excluded = [];
terms = Search._index.terms;
titleterms = Search._index.titleterms;

hits = [[
"index",
Expand All @@ -22,7 +25,7 @@ describe('Basic html theme search', function() {
5,
"index.rst"
]];
expect(Search._performSearch(...searchParameters)).toEqual(hits);
expect(Search.performTermsSearch(searchterms, excluded, terms, titleterms)).toEqual(hits);
});

it('should be able to search for multiple terms', function() {
Expand All @@ -45,7 +48,10 @@ describe('Basic html theme search', function() {
it('should partially-match "sphinx" when in title index', function() {
eval(loadFixture("partial/searchindex.js"));

searchParameters = Search._parseQuery('sphinx');
searchterms = ['sphinx'];
excluded = [];
terms = Search._index.terms;
titleterms = Search._index.titleterms;

hits = [[
"index",
Expand All @@ -55,7 +61,7 @@ describe('Basic html theme search', function() {
7,
"index.rst"
]];
expect(Search._performSearch(...searchParameters)).toEqual(hits);
expect(Search.performTermsSearch(searchterms, excluded, terms, titleterms)).toEqual(hits);
});

});
Expand Down

0 comments on commit 3d108c1

Please sign in to comment.