Skip to content

Commit

Permalink
Add wildcard test matching 0 or more characters
Browse files Browse the repository at this point in the history
  • Loading branch information
olivernn committed Sep 7, 2017
1 parent 81b4fd6 commit 91dd9bd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/token_set_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ suite('lunr.TokenSet', function () {
assert.equal(0, z.toArray().length)
})

test('wildcard matches zero or more characters', function () {
var x = lunr.TokenSet.fromString('foo'),
y = lunr.TokenSet.fromString('foo*'),
z = x.intersect(y)

assert.sameMembers(['foo'], z.toArray())
})

test('intersect with fuzzy string substitution', function () {
var x1 = lunr.TokenSet.fromString('bar'),
x2 = lunr.TokenSet.fromString('cur'),
Expand Down

0 comments on commit 91dd9bd

Please sign in to comment.