2010-03-09 07:06:29 +08:00
|
|
|
require("../common");
|
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
|
|
|
|
fs.stat("does-not-exist-" + i, function (err) {
|
|
|
|
if (err) {
|
|
|
|
j++; // only makes it to about 17
|
|
|
|
puts("finish " + j);
|
|
|
|
} else {
|
|
|
|
throw new Error("this shouldn't be called");
|
|
|
|
}
|
|
|
|
});
|
2010-01-09 14:18:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
process.addListener("exit", function () {
|
|
|
|
assert.equal(N, j);
|
|
|
|
});
|