Skip to content

Commit

Permalink
Add getResult unit test for in between range searching
Browse files Browse the repository at this point in the history
Search::getResult(start, end) seems to be broken for getting results in
range that not starting with 0.
  • Loading branch information
maneeshpm authored and kelson42 committed Aug 4, 2021
1 parent 947b66a commit 953cba7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@ TEST(Search, multiSearch)
it1++;it1++;it1++;
ASSERT_EQ(it1, result1.end());

// Check result retrieval in start ranges
auto result2 = search0.getResults(0, 3); // Should return 3 results
ASSERT_EQ(result2.size(), 3);

// Check result retrieval in middle ranges
auto result3 = search0.getResults(2, 3); // Should Return 1 result
ASSERT_EQ(result3.size(), 1); // Fails!

// Be able to do a different search using the same searcher.
query.setQuery("super", false);
auto search1 = searcher.search(query);
Expand Down

0 comments on commit 953cba7

Please sign in to comment.