From 1be0ee76efda95fda00a30cce76d65b7025fab36 Mon Sep 17 00:00:00 2001 From: Rafael Gonzaga Date: Sat, 10 Aug 2024 17:06:18 -0300 Subject: [PATCH] benchmark: change assert() to assert.ok() PR-URL: https://github.com/nodejs/node/pull/54254 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Yagiz Nizipli Reviewed-By: Luigi Pinca --- benchmark/fs/bench-chownSync.js | 2 +- benchmark/fs/bench-linkSync.js | 2 +- benchmark/fs/bench-readlinkSync.js | 4 ++-- benchmark/fs/bench-readvSync.js | 2 +- benchmark/fs/bench-renameSync.js | 2 +- benchmark/fs/bench-symlinkSync.js | 2 +- benchmark/fs/bench-writevSync.js | 4 ++-- benchmark/fs/read-stream-throughput.js | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/benchmark/fs/bench-chownSync.js b/benchmark/fs/bench-chownSync.js index d07f3b65949979..18e2bd35d5264c 100644 --- a/benchmark/fs/bench-chownSync.js +++ b/benchmark/fs/bench-chownSync.js @@ -45,7 +45,7 @@ function main({ n, type, method }) { } } bench.end(n); - assert(hasError); + assert.ok(hasError); break; } default: diff --git a/benchmark/fs/bench-linkSync.js b/benchmark/fs/bench-linkSync.js index 7c3ef29291913e..ead39c338fe6c8 100644 --- a/benchmark/fs/bench-linkSync.js +++ b/benchmark/fs/bench-linkSync.js @@ -41,7 +41,7 @@ function main({ n, type }) { } } bench.end(n); - assert(hasError); + assert.ok(hasError); break; } default: diff --git a/benchmark/fs/bench-readlinkSync.js b/benchmark/fs/bench-readlinkSync.js index 15c22273e557b6..9b3bbceb42e92f 100644 --- a/benchmark/fs/bench-readlinkSync.js +++ b/benchmark/fs/bench-readlinkSync.js @@ -30,7 +30,7 @@ function main({ n, type }) { returnValue = fs.readlinkSync(tmpdir.resolve(`.readlink-sync-${i}`), { encoding: 'utf8' }); } bench.end(n); - assert(returnValue); + assert.ok(returnValue); break; } @@ -45,7 +45,7 @@ function main({ n, type }) { } } bench.end(n); - assert(hasError); + assert.ok(hasError); break; } default: diff --git a/benchmark/fs/bench-readvSync.js b/benchmark/fs/bench-readvSync.js index c163429b5f6212..21f61ba7e9b7bc 100644 --- a/benchmark/fs/bench-readvSync.js +++ b/benchmark/fs/bench-readvSync.js @@ -49,7 +49,7 @@ function main({ n, type }) { } bench.end(n); - assert(hasError); + assert.ok(hasError); break; } default: diff --git a/benchmark/fs/bench-renameSync.js b/benchmark/fs/bench-renameSync.js index 9f9f5e4e84cda0..2c4c5a39eeb0f4 100644 --- a/benchmark/fs/bench-renameSync.js +++ b/benchmark/fs/bench-renameSync.js @@ -23,7 +23,7 @@ function main({ n, type }) { } } bench.end(n); - assert(hasError); + assert.ok(hasError); break; } case 'valid': { diff --git a/benchmark/fs/bench-symlinkSync.js b/benchmark/fs/bench-symlinkSync.js index 5bf4e0e50779d9..92ceb3579a42e3 100644 --- a/benchmark/fs/bench-symlinkSync.js +++ b/benchmark/fs/bench-symlinkSync.js @@ -42,7 +42,7 @@ function main({ n, type }) { } } bench.end(n); - assert(hasError); + assert.ok(hasError); break; } default: diff --git a/benchmark/fs/bench-writevSync.js b/benchmark/fs/bench-writevSync.js index 596359c6750011..bdcd0919050b4a 100644 --- a/benchmark/fs/bench-writevSync.js +++ b/benchmark/fs/bench-writevSync.js @@ -30,7 +30,7 @@ function main({ n, type }) { } bench.end(n); - assert(result); + assert.ok(result); fs.closeSync(fd); break; case 'invalid': { @@ -46,7 +46,7 @@ function main({ n, type }) { } bench.end(n); - assert(hasError); + assert.ok(hasError); break; } default: diff --git a/benchmark/fs/read-stream-throughput.js b/benchmark/fs/read-stream-throughput.js index 9d4431d360e7d2..e3705b6c327f45 100644 --- a/benchmark/fs/read-stream-throughput.js +++ b/benchmark/fs/read-stream-throughput.js @@ -67,7 +67,7 @@ function main(conf) { } function runTest(filesize, highWaterMark, encoding, n) { - assert(fs.statSync(filename).size === filesize * n); + assert.strictEqual(fs.statSync(filename).size, filesize * n); const rs = fs.createReadStream(filename, { highWaterMark, encoding,