Skip to content

Commit

Permalink
benchmark: use assert.ok instead of assert
Browse files Browse the repository at this point in the history
PR-URL: #54176
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
RafaelGSS authored and targos committed Aug 14, 2024
1 parent 670c796 commit db0a80a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-atob.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ function main({ n, size }) {
out += atob(input).length;
}
bench.end(n);
assert(out > 0);
assert.ok(out > 0);
}
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-btoa.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ function main({ n, size }) {
out += btoa(input).length;
}
bench.end(n);
assert(out > 0);
assert.ok(out > 0);
}
6 changes: 3 additions & 3 deletions benchmark/buffers/buffer-iterate.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ function main({ size, type, method, n }) {
function benchFor(buffer, n) {
for (let k = 0; k < n; k++) {
for (let i = 0; i < buffer.length; i++) {
assert(buffer[i] === 0);
assert.strictEqual(buffer[i], 0);
}
}
}

function benchForOf(buffer, n) {
for (let k = 0; k < n; k++) {
for (const b of buffer) {
assert(b === 0);
assert.strictEqual(b, 0);
}
}
}
Expand All @@ -50,7 +50,7 @@ function benchIterator(buffer, n) {
let cur = iter.next();

while (!cur.done) {
assert(cur.value === 0);
assert.strictEqual(cur.value, 0);
cur = iter.next();
}

Expand Down

0 comments on commit db0a80a

Please sign in to comment.