This commit is contained in:
Wu Jian Ping
2022-07-21 18:09:08 +08:00
parent 12aee0894d
commit 0ffa58b592
6 changed files with 98 additions and 62 deletions

View File

@@ -12,17 +12,17 @@ const searcher2 = Searcher.newWithVectorIndex(dbPath, vectorIndex)
const searcher3 = Searcher.newWithFileOnly(dbPath)
describe('ip2region', () => {
it('#newWithFileOnly', async () => {
it('#newWithFileOnly and search', async () => {
const d = await searcher3.search('218.4.167.70')
expect(d).equal('中国|0|江苏省|苏州市|电信')
})
it('#newWithVectorIndex', async () => {
it('#newWithVectorIndex and search', async () => {
const d = await searcher2.search('218.4.167.70')
expect(d).equal('中国|0|江苏省|苏州市|电信')
})
it('#newWithBuffer', async () => {
it('#newWithBuffer and search', async () => {
const d = await searcher1.search('218.4.167.70')
expect(d).equal('中国|0|江苏省|苏州市|电信')
})