Skip to content

Commit

Permalink
fix: Allow query string to contain weird whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
thesephist committed Jul 21, 2022
1 parent df86471 commit b0e1879
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ describe('basic search', () => {
]);
});

it('search query may contain newlines, tabs, and multiple consecutive spaces', () => {
assert.deepEqual(search(ITEMS, ' linus\t is\nperson\t', x => x.name), [
item('linus is a person'),
]);
});

it('correctly implements TF-IDF ranking', () => {
//> In this example, "mango" has much higher IDF (is a higher-signal
// word) in the corpus than "apple", which appears in nearly every
Expand Down

0 comments on commit b0e1879

Please # to comment.