mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
547 B
27 lines
547 B
include("mjsunit.js");
|
|
|
|
var got_error = false;
|
|
var opened = false;
|
|
var closed = false;
|
|
|
|
function onLoad () {
|
|
var dirname = node.path.dirname(__filename);
|
|
var fixtures = node.path.join(dirname, "fixtures");
|
|
var x = node.path.join(fixtures, "x.txt");
|
|
|
|
file = new node.fs.File;
|
|
file.onError = function () { got_error = true };
|
|
|
|
file.open(x, "r", function () {
|
|
opened = true
|
|
file.close(function () {
|
|
closed = true;
|
|
});
|
|
});
|
|
}
|
|
|
|
function onExit () {
|
|
assertFalse(got_error);
|
|
assertTrue(opened);
|
|
assertTrue(closed);
|
|
}
|
|
|