node/test/mjsunit/test-file-cat-noexist.js

21 lines
505 B
JavaScript
Raw Normal View History

process.mixin(require("./common"));
2009-06-29 01:05:58 +08:00
var got_error = false;
2009-06-01 18:56:28 +08:00
var filename = path.join(fixturesDir, "does_not_exist.txt");
var promise = posix.cat(filename, "raw");
2009-06-29 01:05:58 +08:00
2009-08-27 00:22:00 +08:00
promise.addCallback(function (content) {
debug("cat returned some content: " + content);
debug("this shouldn't happen as the file doesn't exist...");
assert.equal(true, false);
2009-08-27 00:22:00 +08:00
});
promise.addErrback(function () {
got_error = true;
});
2009-06-01 18:56:28 +08:00
process.addListener("exit", function () {
puts("done");
assert.equal(true, got_error);
});