From db0a80a0eb84106f6070ea1e33a4311c14989239 Mon Sep 17 00:00:00 2001 From: Rafael Gonzaga Date: Sun, 4 Aug 2024 10:29:34 -0300 Subject: [PATCH] benchmark: use assert.ok instead of assert PR-URL: https://github.com/nodejs/node/pull/54176 Reviewed-By: Yagiz Nizipli Reviewed-By: Antoine du Hamel Reviewed-By: Trivikram Kamat Reviewed-By: Luigi Pinca --- benchmark/buffers/buffer-atob.js | 2 +- benchmark/buffers/buffer-btoa.js | 2 +- benchmark/buffers/buffer-iterate.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/benchmark/buffers/buffer-atob.js b/benchmark/buffers/buffer-atob.js index 2cc20759e3f0f6..ee986e49e5e9ae 100644 --- a/benchmark/buffers/buffer-atob.js +++ b/benchmark/buffers/buffer-atob.js @@ -16,5 +16,5 @@ function main({ n, size }) { out += atob(input).length; } bench.end(n); - assert(out > 0); + assert.ok(out > 0); } diff --git a/benchmark/buffers/buffer-btoa.js b/benchmark/buffers/buffer-btoa.js index 3867d5890b1d79..5bfe7cff3db179 100644 --- a/benchmark/buffers/buffer-btoa.js +++ b/benchmark/buffers/buffer-btoa.js @@ -16,5 +16,5 @@ function main({ n, size }) { out += btoa(input).length; } bench.end(n); - assert(out > 0); + assert.ok(out > 0); } diff --git a/benchmark/buffers/buffer-iterate.js b/benchmark/buffers/buffer-iterate.js index 57a15e42249742..c1c4f6917501a1 100644 --- a/benchmark/buffers/buffer-iterate.js +++ b/benchmark/buffers/buffer-iterate.js @@ -31,7 +31,7 @@ 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); } } } @@ -39,7 +39,7 @@ function benchFor(buffer, n) { function benchForOf(buffer, n) { for (let k = 0; k < n; k++) { for (const b of buffer) { - assert(b === 0); + assert.strictEqual(b, 0); } } } @@ -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(); }