Clean up and rename test-stat-handler
authorRyan Dahl <ry@tinyclouds.org>
Wed, 17 Feb 2010 22:30:50 +0000 (14:30 -0800)
committerRyan Dahl <ry@tinyclouds.org>
Wed, 17 Feb 2010 22:30:50 +0000 (14:30 -0800)
test/mjsunit/test-stat-handler.js [deleted file]
test/mjsunit/test-watch-file.js [new file with mode: 0644]

diff --git a/test/mjsunit/test-stat-handler.js b/test/mjsunit/test-stat-handler.js
deleted file mode 100644 (file)
index ee3cd8b..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-process.mixin(require("./common"));
-
-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 (curr, prev) {
-  puts(f + " change");
-  changes++;
-  assert.equal(true, curr.mtime != prev.mtime);
-  process.unwatchFile(f);
-});
-
-
-var fs = require("fs");
-
-var fd = fs.openSync(f, "w+");
-fs.writeSync(fd, 'xyz\n');
-fs.closeSync(fd);
-
-process.addListener("exit", function () {
-  assert.equal(true, changes > 0);
-});
diff --git a/test/mjsunit/test-watch-file.js b/test/mjsunit/test-watch-file.js
new file mode 100644 (file)
index 0000000..977e583
--- /dev/null
@@ -0,0 +1,27 @@
+process.mixin(require("./common"));
+
+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 (curr, prev) {
+  puts(f + " change");
+  changes++;
+  assert.ok(curr.mtime != prev.mtime);
+  process.unwatchFile(f);
+});
+
+
+var fs = require("fs");
+
+var fd = fs.openSync(f, "w+");
+fs.writeSync(fd, 'xyz\n');
+fs.closeSync(fd);
+
+process.addListener("exit", function () {
+  assert.ok(changes > 0);
+});