更新bench app,增加比对结果

This commit is contained in:
Wu Jian Ping 2022-07-22 13:44:23 +08:00
parent 6165c92baa
commit f06e4b2544
1 changed files with 8 additions and 1 deletions

View File

@ -91,7 +91,14 @@ const main = async () => {
const mipInt = Math.floor((sipInt + eipInt) / 2) const mipInt = Math.floor((sipInt + eipInt) / 2)
const mip = intToIp(mipInt) 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++ total++
}) })
.on('error', err => { .on('error', err => {