Skip to content

Commit 7106734

Browse files
TrottMylesBorins
authored andcommitted
test: add test-benchmark-buffer
Add minimal test forbuffer benchmarks. PR-URL: #15175 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]
1 parent 8d11220 commit 7106734

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
'use strict';
2+
3+
require('../common');
4+
5+
// Minimal test for buffer benchmarks. This makes sure the benchmarks aren't
6+
// completely broken but nothing more than that.
7+
8+
const assert = require('assert');
9+
const fork = require('child_process').fork;
10+
const path = require('path');
11+
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+
});

0 commit comments

Comments
 (0)