From 6e6562e551e74e7b8d86c77c582f92e708ef91e8 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 17 Nov 2009 14:52:18 +0100 Subject: [PATCH] Fix stat handler test for macintosh --- test/mjsunit/test-stat-handler.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/mjsunit/test-stat-handler.js b/test/mjsunit/test-stat-handler.js index 32b1fe8cfce..4c520880d86 100644 --- a/test/mjsunit/test-stat-handler.js +++ b/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 () {