mkdir EEXIST test

Fixed on uv 3c00d87b4239a6b8358e2085f806170c3eca10cf
v0.7.4-release
isaacs 2011-09-12 17:10:24 -07:00
parent 8b6277a460
commit 190abcac9d
1 changed files with 15 additions and 8 deletions

View File

@ -35,6 +35,12 @@ fs.mkdir(d, 0666, function(err) {
console.log('mkdir error: ' + err.message);
mkdir_error = true;
} else {
fs.mkdir(d, 0666, function(err) {
console.log('expect EEXIST error: ', err);
assert.ok(err.message.match(/^EEXIST/), 'got EEXIST message');
assert.equal(err.code, 'EEXIST', 'got EEXIST code');
assert.equal(err.path, d, 'got proper path for EEXIST');
console.log('mkdir okay!');
fs.rmdir(d, function(err) {
if (err) {
@ -44,6 +50,7 @@ fs.mkdir(d, 0666, function(err) {
console.log('rmdir okay!');
}
});
});
}
});