Browse Source

Migrated from sys.p to console.dir

v0.7.4-release
Micheil Smith 14 years ago
committed by Ryan Dahl
parent
commit
372a7c9a3e
  1. 4
      test/pummel/test-net-timeout.js
  2. 6
      test/simple/test-c-ares.js
  3. 2
      test/simple/test-child-process-buffering.js
  4. 4
      test/simple/test-exec.js
  5. 10
      test/simple/test-fs-stat.js
  6. 2
      test/simple/test-http.js
  7. 2
      test/simple/test-net-binary.js
  8. 4
      test/simple/test-readdir.js

4
test/pummel/test-net-timeout.js

@ -12,7 +12,7 @@ var echo_server = net.createServer(function (socket) {
socket.addListener("timeout", function () { socket.addListener("timeout", function () {
console.log("server timeout"); console.log("server timeout");
timeouttime = new Date; timeouttime = new Date;
common.p(timeouttime); console.dir(timeouttime);
socket.destroy(); socket.destroy();
}); });
@ -53,7 +53,7 @@ client.addListener("data", function (chunk) {
if (exchanges == 5) { if (exchanges == 5) {
console.log("wait for timeout - should come in " + timeout + " ms"); console.log("wait for timeout - should come in " + timeout + " ms");
starttime = new Date; starttime = new Date;
common.p(starttime); console.dir(starttime);
} }
} }
}); });

6
test/simple/test-c-ares.js

@ -7,12 +7,12 @@ var dns = require("dns");
// Try resolution without callback // Try resolution without callback
dns.getHostByName('localhost', function (error, result) { dns.getHostByName('localhost', function (error, result) {
common.p(result); console.dir(result);
assert.deepEqual(['127.0.0.1'], result); assert.deepEqual(['127.0.0.1'], result);
}); });
dns.getHostByName('127.0.0.1', function (error, result) { dns.getHostByName('127.0.0.1', function (error, result) {
common.p(result); console.dir(result);
assert.deepEqual(['127.0.0.1'], result); assert.deepEqual(['127.0.0.1'], result);
}); });
@ -33,7 +33,7 @@ dns.lookup('::1', function (error, result, addressType) {
dns.lookup('ipv6.google.com', function (error, result, addressType) { dns.lookup('ipv6.google.com', function (error, result, addressType) {
if (error) throw error; if (error) throw error;
common.p(arguments); console.dir(arguments);
//assert.equal('string', typeof result); //assert.equal('string', typeof result);
assert.equal(6, addressType); assert.equal(6, addressType);
}); });

2
test/simple/test-child-process-buffering.js

@ -25,7 +25,7 @@ function pwd (callback) {
pwd(function (result) { pwd(function (result) {
common.p(result); console.dir(result);
assert.equal(true, result.length > 1); assert.equal(true, result.length > 1);
assert.equal("\n", result[result.length-1]); assert.equal("\n", result[result.length-1]);
}); });

4
test/simple/test-exec.js

@ -13,7 +13,7 @@ exec("ls /", function (err, stdout, stderr) {
assert.equal(false, err.killed); assert.equal(false, err.killed);
} else { } else {
success_count++; success_count++;
common.p(stdout); console.dir(stdout);
} }
}); });
@ -30,7 +30,7 @@ exec("ls /DOES_NOT_EXIST", function (err, stdout, stderr) {
console.log("stderr: " + JSON.stringify(stderr)); console.log("stderr: " + JSON.stringify(stderr));
} else { } else {
success_count++; success_count++;
common.p(stdout); console.dir(stdout);
assert.equal(true, stdout != ""); assert.equal(true, stdout != "");
} }
}); });

10
test/simple/test-fs-stat.js

@ -8,7 +8,7 @@ fs.stat(".", function (err, stats) {
if (err) { if (err) {
got_error = true; got_error = true;
} else { } else {
common.p(stats); console.dir(stats);
assert.ok(stats.mtime instanceof Date); assert.ok(stats.mtime instanceof Date);
success_count++; success_count++;
} }
@ -18,7 +18,7 @@ fs.lstat(".", function (err, stats) {
if (err) { if (err) {
got_error = true; got_error = true;
} else { } else {
common.p(stats); console.dir(stats);
assert.ok(stats.mtime instanceof Date); assert.ok(stats.mtime instanceof Date);
success_count++; success_count++;
} }
@ -33,7 +33,7 @@ fs.open(".", "r", undefined, function(err, fd) {
if (err) { if (err) {
got_error = true; got_error = true;
} else { } else {
common.p(stats); console.dir(stats);
assert.ok(stats.mtime instanceof Date); assert.ok(stats.mtime instanceof Date);
success_count++; success_count++;
fs.close(fd); fs.close(fd);
@ -50,7 +50,7 @@ fs.open(".", "r", undefined, function(err, fd) {
got_error = true; got_error = true;
} }
if (stats) { if (stats) {
common.p(stats); console.dir(stats);
assert.ok(stats.mtime instanceof Date); assert.ok(stats.mtime instanceof Date);
success_count++; success_count++;
} }
@ -62,7 +62,7 @@ fs.stat(__filename, function (err, s) {
if (err) { if (err) {
got_error = true; got_error = true;
} else { } else {
common.p(s); console.dir(s);
success_count++; success_count++;
console.log("isDirectory: " + JSON.stringify( s.isDirectory() ) ); console.log("isDirectory: " + JSON.stringify( s.isDirectory() ) );

2
test/simple/test-http.js

@ -17,7 +17,7 @@ var server = http.Server(function (req, res) {
assert.equal("GET", req.method); assert.equal("GET", req.method);
assert.equal("/hello", url.parse(req.url).pathname); assert.equal("/hello", url.parse(req.url).pathname);
common.p(req.headers); console.dir(req.headers);
assert.equal(true, "accept" in req.headers); assert.equal(true, "accept" in req.headers);
assert.equal("*/*", req.headers["accept"]); assert.equal("*/*", req.headers["accept"]);

2
test/simple/test-net-binary.js

@ -55,7 +55,7 @@ echoServer.addListener("listening", function() {
}); });
c.addListener("close", function () { c.addListener("close", function () {
common.p(recv); console.dir(recv);
echoServer.close(); echoServer.close();
}); });
}); });

4
test/simple/test-readdir.js

@ -19,7 +19,7 @@ var files = ['are'
console.log('readdirSync ' + readdirDir); console.log('readdirSync ' + readdirDir);
var f = fs.readdirSync(readdirDir); var f = fs.readdirSync(readdirDir);
common.p(f); console.dir(f);
assert.deepEqual(files, f.sort()); assert.deepEqual(files, f.sort());
@ -29,7 +29,7 @@ fs.readdir(readdirDir, function (err, f) {
console.log("error"); console.log("error");
got_error = true; got_error = true;
} else { } else {
common.p(f); console.dir(f);
assert.deepEqual(files, f.sort()); assert.deepEqual(files, f.sort());
} }
}); });

Loading…
Cancel
Save