Skip to content

Commit b0e1879

Browse files
committed
fix: Allow query string to contain weird whitespace
1 parent df86471 commit b0e1879

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/search.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ describe('basic search', () => {
5252
]);
5353
});
5454

55+
it('search query may contain newlines, tabs, and multiple consecutive spaces', () => {
56+
assert.deepEqual(search(ITEMS, ' linus\t is\nperson\t', x => x.name), [
57+
item('linus is a person'),
58+
]);
59+
});
60+
5561
it('correctly implements TF-IDF ranking', () => {
5662
//> In this example, "mango" has much higher IDF (is a higher-signal
5763
// word) in the corpus than "apple", which appears in nearly every

0 commit comments

Comments
 (0)