Skip to content

Commit

Permalink
improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaina committed Mar 8, 2024
1 parent 35c2e84 commit 4a1a327
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion test/performance/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ function round3(value) {
export class PerformanceBase {
constructor(
TRYES,
title = 'Performance test',
log = console.log,
) {
this.TRYES = TRYES;
this.log = log;
this.log(chalk.bold('Performance test, TRYES:'), TRYES);
this.log(chalk.bold(title), 'TRYES:', TRYES);
}

start(
Expand Down
4 changes: 2 additions & 2 deletions test/performance/base64.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const b64Arr = [72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100];
}

{
function equal(a, b) {
const equal = (a, b) => {
if (a.length !== b.length) return false;
for (let i = 0; i < a.length; i++) {
if (a[i] !== b[i]) return false;
Expand All @@ -69,7 +69,7 @@ const b64Arr = [72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100];
test.end();
}
{
function equal(a, b) {
const equal = (a, b) => {
if (a.length !== b.length) return false;
return a.every((v, i) => v === b[i]);
}
Expand Down

0 comments on commit 4a1a327

Please sign in to comment.