Skip to content

benchmark: use consistent coding style in assert/* #25865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions benchmark/assert/deepequal-buffer.js
Original file line number Diff line number Diff line change
@@ -6,10 +6,7 @@ const bench = common.createBenchmark(main, {
n: [2e4],
len: [1e2, 1e3],
strict: [0, 1],
method: [
'deepEqual',
'notDeepEqual'
]
method: [ 'deepEqual', 'notDeepEqual' ],
});

function main({ len, n, method, strict }) {
4 changes: 2 additions & 2 deletions benchmark/assert/deepequal-map.js
Original file line number Diff line number Diff line change
@@ -14,8 +14,8 @@ const bench = common.createBenchmark(main, {
'deepEqual_mixed',
'notDeepEqual_primitiveOnly',
'notDeepEqual_objectOnly',
'notDeepEqual_mixed'
]
'notDeepEqual_mixed',
],
});

function benchmark(method, n, values, values2) {
9 changes: 3 additions & 6 deletions benchmark/assert/deepequal-object.js
Original file line number Diff line number Diff line change
@@ -7,10 +7,7 @@ const bench = common.createBenchmark(main, {
n: [5e3],
size: [1e2, 1e3, 5e4],
strict: [0, 1],
method: [
'deepEqual',
'notDeepEqual'
]
method: [ 'deepEqual', 'notDeepEqual' ],
});

function createObj(source, add = '') {
@@ -21,8 +18,8 @@ function createObj(source, add = '') {
a: [1, 2, 3],
baz: n,
c: {},
b: []
}
b: [],
},
}));
}

6 changes: 3 additions & 3 deletions benchmark/assert/deepequal-prims-and-objs-big-array-set.js
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ const primValues = {
'string': 'a',
'number': 1,
'object': { 0: 'a' },
'array': [1, 2, 3]
'array': [1, 2, 3],
};

const bench = common.createBenchmark(main, {
@@ -20,8 +20,8 @@ const bench = common.createBenchmark(main, {
'deepEqual_Array',
'notDeepEqual_Array',
'deepEqual_Set',
'notDeepEqual_Set'
]
'notDeepEqual_Set',
],
});

function run(fn, n, actual, expected) {
7 changes: 2 additions & 5 deletions benchmark/assert/deepequal-prims-and-objs-big-loop.js
Original file line number Diff line number Diff line change
@@ -6,17 +6,14 @@ const primValues = {
'string': 'a',
'number': 1,
'object': { 0: 'a' },
'array': [1, 2, 3]
'array': [1, 2, 3],
};

const bench = common.createBenchmark(main, {
primitive: Object.keys(primValues),
n: [2e4],
strict: [0, 1],
method: [
'deepEqual',
'notDeepEqual',
]
method: [ 'deepEqual', 'notDeepEqual' ],
});

function main({ n, primitive, method, strict }) {
4 changes: 2 additions & 2 deletions benchmark/assert/deepequal-set.js
Original file line number Diff line number Diff line change
@@ -14,8 +14,8 @@ const bench = common.createBenchmark(main, {
'deepEqual_mixed',
'notDeepEqual_primitiveOnly',
'notDeepEqual_objectOnly',
'notDeepEqual_mixed'
]
'notDeepEqual_mixed',
],
});

function benchmark(method, n, values, values2) {
2 changes: 1 addition & 1 deletion benchmark/assert/deepequal-typedarrays.js
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ const bench = common.createBenchmark(main, {
'deepEqual',
'notDeepEqual',
],
len: [1e2, 5e3]
len: [1e2, 5e3],
});

function main({ type, n, len, method, strict }) {
4 changes: 1 addition & 3 deletions benchmark/assert/ok.js
Original file line number Diff line number Diff line change
@@ -3,9 +3,7 @@
const common = require('../common.js');
const assert = require('assert');

const bench = common.createBenchmark(main, {
n: [1e5]
});
const bench = common.createBenchmark(main, { n: [1e5] });

function main({ n }) {
var i;
6 changes: 1 addition & 5 deletions benchmark/assert/throws.js
Original file line number Diff line number Diff line change
@@ -5,11 +5,7 @@ const { throws, doesNotThrow } = require('assert');

const bench = common.createBenchmark(main, {
n: [1e4],
method: [
'doesNotThrow',
'throws_TypeError',
'throws_RegExp'
]
method: [ 'doesNotThrow', 'throws_TypeError', 'throws_RegExp' ],
});

function main({ n, method }) {