Browse Source

Fix stat handler test for macintosh

v0.7.4-release
Ryan Dahl 16 years ago
parent
commit
6e6562e551
  1. 14
      test/mjsunit/test-stat-handler.js

14
test/mjsunit/test-stat-handler.js

@ -1,23 +1,25 @@
process.mixin(require("./common"));
var posix = require("posix");
var path = require("path");
var f = path.join(fixturesDir, "x.txt");
var f2 = path.join(fixturesDir, "x2.txt");
puts("watching for changes of " + f);
var changes = 0;
process.watchFile(f, function () {
puts(f + " change");
changes++;
process.unwatchFile(f);
});
setTimeout(function () {
posix.rename(f, f2).wait();
posix.rename(f2, f).wait();
process.unwatchFile(f);
}, 10);
var File = require("file").File;
var file = new File(f, 'w+');
file.write('xyz\n');
file.close().wait();
process.addListener("exit", function () {

Loading…
Cancel
Save