blob: 52809a339830587d5ee23f9fbe6c5df81256b9c4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
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);
}
|