Skip to content

Commit a906645

Browse files
maclover7jasnell
authored andcommitted
test: convert buffer benchmark to runBenchmark
PR-URL: #15349 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]>
1 parent 45cdbcf commit a906645

File tree

1 file changed

+18
-28
lines changed

1 file changed

+18
-28
lines changed

test/sequential/test-benchmark-buffer.js

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,23 @@
22

33
require('../common');
44

5-
// Minimal test for buffer benchmarks. This makes sure the benchmarks aren't
6-
// completely broken but nothing more than that.
5+
const runBenchmark = require('../common/benchmark');
76

8-
const assert = require('assert');
9-
const fork = require('child_process').fork;
10-
const path = require('path');
7+
runBenchmark('buffers',
8+
[
9+
'aligned=true',
10+
'args=1',
11+
'encoding=utf8',
12+
'len=2',
13+
'method=',
14+
'n=1',
15+
'noAssert=true',
16+
'pieces=1',
17+
'pieceSize=1',
18+
'search=@',
19+
'size=1',
20+
'source=array',
21+
'type=',
22+
'withTotalLength=0'
1123

12-
const runjs = path.join(__dirname, '..', '..', 'benchmark', 'run.js');
13-
const argv = ['--set', 'aligned=true',
14-
'--set', 'args=1',
15-
'--set', 'buffer=fast',
16-
'--set', 'encoding=utf8',
17-
'--set', 'len=2',
18-
'--set', 'method=',
19-
'--set', 'n=1',
20-
'--set', 'noAssert=true',
21-
'--set', 'pieces=1',
22-
'--set', 'pieceSize=1',
23-
'--set', 'search=@',
24-
'--set', 'size=1',
25-
'--set', 'source=array',
26-
'--set', 'type=',
27-
'--set', 'withTotalLength=0',
28-
'buffers'];
29-
30-
const child = fork(runjs, argv);
31-
child.on('exit', (code, signal) => {
32-
assert.strictEqual(code, 0);
33-
assert.strictEqual(signal, null);
34-
});
24+
]);

0 commit comments

Comments
 (0)