mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
828 B
40 lines
828 B
common = require("../common");
|
|
assert = common.assert
|
|
var path = require('path');
|
|
var fs = require('fs');
|
|
|
|
var got_error = false,
|
|
readdirDir = path.join(common.fixturesDir, "readdir")
|
|
|
|
var files = ['are'
|
|
, 'dir'
|
|
, 'empty'
|
|
, 'files'
|
|
, 'for'
|
|
, 'just'
|
|
, 'testing.js'
|
|
, 'these'
|
|
];
|
|
|
|
|
|
console.log('readdirSync ' + readdirDir);
|
|
var f = fs.readdirSync(readdirDir);
|
|
common.p(f);
|
|
assert.deepEqual(files, f.sort());
|
|
|
|
|
|
console.log("readdir " + readdirDir);
|
|
fs.readdir(readdirDir, function (err, f) {
|
|
if (err) {
|
|
console.log("error");
|
|
got_error = true;
|
|
} else {
|
|
common.p(f);
|
|
assert.deepEqual(files, f.sort());
|
|
}
|
|
});
|
|
|
|
process.addListener("exit", function () {
|
|
assert.equal(false, got_error);
|
|
console.log("exit");
|
|
});
|
|
|