First commit
This commit is contained in:
25
node_modules/vasync/tests/issue-21.js
generated
vendored
Normal file
25
node_modules/vasync/tests/issue-21.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Tests that if the user modifies the list of functions passed to
|
||||
* vasync.pipeline, vasync ignores the changes and does not crash.
|
||||
*/
|
||||
var assert = require('assert');
|
||||
var vasync = require('../lib/vasync');
|
||||
var count = 0;
|
||||
var funcs;
|
||||
|
||||
function doStuff(_, callback)
|
||||
{
|
||||
count++;
|
||||
setImmediate(callback);
|
||||
}
|
||||
|
||||
funcs = [ doStuff, doStuff, doStuff ];
|
||||
|
||||
vasync.pipeline({
|
||||
'funcs': funcs
|
||||
}, function (err) {
|
||||
assert.ok(!err);
|
||||
assert.ok(count === 3);
|
||||
});
|
||||
|
||||
funcs.push(doStuff);
|
||||
Reference in New Issue
Block a user