Skip to content

Commit

Permalink
test: add test-benchmark-buffer
Browse files Browse the repository at this point in the history
Add minimal test forbuffer benchmarks.

PR-URL: #15175
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com
  • Loading branch information
Trott authored and MylesBorins committed Sep 10, 2017
1 parent 4f4efb9 commit 704faa1
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/parallel/test-benchmark-buffer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
'use strict';

require('../common');

// Minimal test for buffer benchmarks. This makes sure the benchmarks aren't
// completely broken but nothing more than that.

const assert = require('assert');
const fork = require('child_process').fork;
const path = require('path');

const runjs = path.join(__dirname, '..', '..', 'benchmark', 'run.js');
const argv = ['--set', 'aligned=true',
'--set', 'args=1',
'--set', 'buffer=fast',
'--set', 'encoding=utf8',
'--set', 'len=2',
'--set', 'method=',
'--set', 'n=1',
'--set', 'noAssert=true',
'--set', 'pieces=1',
'--set', 'pieceSize=1',
'--set', 'search=@',
'--set', 'size=1',
'--set', 'source=array',
'--set', 'type=',
'--set', 'withTotalLength=0',
'buffers'];

const child = fork(runjs, argv);
child.on('exit', (code, signal) => {
assert.strictEqual(code, 0);
assert.strictEqual(signal, null);
});

0 comments on commit 704faa1

Please sign in to comment.