Skip to content

Commit

Permalink
test: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tsctx committed Dec 7, 2023
1 parent bd17e95 commit 1d4a848
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ test('Ternary Search Tree', (t) => {
const randomBuffer = random.map((c) => Buffer.from(c))

for (let i = 0; i < random.length; ++i) {
const key = random[i]
const lowerCasedKey = key.toLowerCase()
const buffer = Buffer.from(lowerCasedKey)
tst.insert(buffer, lowerCasedKey)
const key = random[i] = random[i].toLowerCase()
tst.insert(Buffer.from(key), key)
}
t.test('all', (t) => {
for (let i = 0; i < randomBuffer.length; ++i) {
t.equal(tst.lookup(randomBuffer[i]), random[i].toLowerCase())
t.equal(tst.lookup(randomBuffer[i]), random[i])
}
t.end()
})
Expand Down

0 comments on commit 1d4a848

Please sign in to comment.