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

Commit

Permalink
test: fs.realpath() should not call its callback twice
Browse files Browse the repository at this point in the history
Test case for #2045.
  • Loading branch information
bnoordhuis committed Nov 8, 2011
1 parent b1bb17f commit 6f96e78
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/simple/test-fs-realpath.js
Expand Up @@ -79,6 +79,19 @@ function bashRealpath(path, callback) {
}

// sub-tests:
function test_simple_error_callback() {
var ncalls = 0;

fs.realpath('/this/path/does/not/exist', function(err, s) {
assert(err);
assert(!s);
ncalls++;
});

process.on('exit', function() {
assert.equal(ncalls, 1);
});
}

function test_simple_relative_symlink(callback) {
console.log('test_simple_relative_symlink');
Expand Down Expand Up @@ -415,6 +428,7 @@ function test_lying_cache_liar(cb) {
// ----------------------------------------------------------------------------

var tests = [
test_simple_error_callback,
test_simple_relative_symlink,
test_simple_absolute_symlink,
test_deep_relative_file_symlink,
Expand Down

0 comments on commit 6f96e78

Please sign in to comment.