Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
mkdir EEXIST test
Browse files Browse the repository at this point in the history
Fixed on uv 3c00d87b4239a6b8358e2085f806170c3eca10cf
  • Loading branch information
isaacs committed Sep 13, 2011
1 parent 8b6277a commit 190abca
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions test/simple/test-mkdir-rmdir.js
Expand Up @@ -35,14 +35,21 @@ fs.mkdir(d, 0666, function(err) {
console.log('mkdir error: ' + err.message);
mkdir_error = true;
} else {
console.log('mkdir okay!');
fs.rmdir(d, function(err) {
if (err) {
console.log('rmdir error: ' + err.message);
rmdir_error = true;
} else {
console.log('rmdir okay!');
}
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) {
console.log('rmdir error: ' + err.message);
rmdir_error = true;
} else {
console.log('rmdir okay!');
}
});
});
}
});
Expand Down

0 comments on commit 190abca

Please sign in to comment.