2015-05-19 19:00:06 +08:00
|
|
|
'use strict';
|
2010-12-05 07:20:34 +08:00
|
|
|
var common = require('../common');
|
|
|
|
var assert = require('assert');
|
2010-03-09 02:02:19 +08:00
|
|
|
var fs = require('fs');
|
2010-01-09 14:18:18 +08:00
|
|
|
var N = 100;
|
|
|
|
var j = 0;
|
|
|
|
|
|
|
|
for (var i = 0; i < N; i++) {
|
2010-02-20 08:02:30 +08:00
|
|
|
// these files don't exist
|
2010-12-06 03:15:30 +08:00
|
|
|
fs.stat('does-not-exist-' + i, function(err) {
|
2010-02-20 08:02:30 +08:00
|
|
|
if (err) {
|
|
|
|
j++; // only makes it to about 17
|
2010-12-06 03:15:30 +08:00
|
|
|
console.log('finish ' + j);
|
2010-02-20 08:02:30 +08:00
|
|
|
} else {
|
2010-12-06 03:15:30 +08:00
|
|
|
throw new Error('this shouldn\'t be called');
|
2010-02-20 08:02:30 +08:00
|
|
|
}
|
2010-06-30 14:12:46 +08:00
|
|
|
});
|
2010-01-09 14:18:18 +08:00
|
|
|
}
|
|
|
|
|
2011-10-15 07:08:36 +08:00
|
|
|
process.on('exit', function() {
|
2010-01-09 14:18:18 +08:00
|
|
|
assert.equal(N, j);
|
|
|
|
});
|