Browse Source

test: fs.realpath() should not call its callback twice

Test case for #2045.
v0.7.4-release
Ben Noordhuis 13 years ago
parent
commit
6f96e78dea
  1. 14
      test/simple/test-fs-realpath.js

14
test/simple/test-fs-realpath.js

@ -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');
@ -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,

Loading…
Cancel
Save