mirror of
https://github.com/netfun2000/ip2region.git
synced 2026-02-27 09:44:31 +08:00
更新bench app,增加比对结果
This commit is contained in:
@@ -91,7 +91,14 @@ const main = async () => {
|
||||
const mipInt = Math.floor((sipInt + eipInt) / 2)
|
||||
const mip = intToIp(mipInt)
|
||||
|
||||
await searcher.search(mip)
|
||||
const info = await searcher.search(mip)
|
||||
|
||||
const region = list.slice(2, list.length).join('|')
|
||||
// check the region info
|
||||
if (region !== info.region) {
|
||||
console.log(`failed search(${mip}) with (${region} != ${info.region})`)
|
||||
process.exit(1)
|
||||
}
|
||||
total++
|
||||
})
|
||||
.on('error', err => {
|
||||
|
||||
Reference in New Issue
Block a user