Browse Source

test: use strictEqual in test-debugger-client.js

PR-URL: https://github.com/nodejs/node/pull/9857
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
v6
ben_cripps 8 years ago
committed by Rich Trott
parent
commit
4658d0c8ce
  1. 26
      test/debugger/test-debugger-client.js

26
test/debugger/test-debugger-client.js

@ -25,40 +25,40 @@ p.execute('Type: connect\r\n' +
'Protocol-Version: 1\r\n' + 'Protocol-Version: 1\r\n' +
'Embedding-Host: node v0.3.3-pre\r\n' + 'Embedding-Host: node v0.3.3-pre\r\n' +
'Content-Length: 0\r\n\r\n'); 'Content-Length: 0\r\n\r\n');
assert.equal(1, resCount); assert.strictEqual(resCount, 1);
// Make sure split messages go in. // Make sure split messages go in.
var parts = []; var parts = [];
parts.push('Content-Length: 336\r\n'); parts.push('Content-Length: 336\r\n');
assert.equal(21, parts[0].length); assert.strictEqual(parts[0].length, 21);
parts.push('\r\n'); parts.push('\r\n');
assert.equal(2, parts[1].length); assert.strictEqual(parts[1].length, 2);
var bodyLength = 0; var bodyLength = 0;
parts.push('{"seq":12,"type":"event","event":"break","body":' + parts.push('{"seq":12,"type":"event","event":"break","body":' +
'{"invocationText":"#<a Server>'); '{"invocationText":"#<a Server>');
assert.equal(78, parts[2].length); assert.strictEqual(parts[2].length, 78);
bodyLength += parts[2].length; bodyLength += parts[2].length;
parts.push('.[anonymous](req=#<an IncomingMessage>, ' + parts.push('.[anonymous](req=#<an IncomingMessage>, ' +
'res=#<a ServerResponse>)","sourceLine"'); 'res=#<a ServerResponse>)","sourceLine"');
assert.equal(78, parts[3].length); assert.strictEqual(parts[3].length, 78);
bodyLength += parts[3].length; bodyLength += parts[3].length;
parts.push(':45,"sourceColumn":4,"sourceLineText":" debugger;",' + parts.push(':45,"sourceColumn":4,"sourceLineText":" debugger;",' +
'"script":{"id":24,"name":"/home/ryan/projects/node/' + '"script":{"id":24,"name":"/home/ryan/projects/node/' +
'benchmark/http_simple.js","lineOffset":0,"columnOffset":0,' + 'benchmark/http_simple.js","lineOffset":0,"columnOffset":0,' +
'"lineCount":98}}}'); '"lineCount":98}}}');
assert.equal(180, parts[4].length); assert.strictEqual(parts[4].length, 180);
bodyLength += parts[4].length; bodyLength += parts[4].length;
assert.equal(336, bodyLength); assert.strictEqual(bodyLength, 336);
for (var i = 0; i < parts.length; i++) { for (var i = 0; i < parts.length; i++) {
p.execute(parts[i]); p.execute(parts[i]);
} }
assert.equal(2, resCount); assert.strictEqual(resCount, 2);
// Make sure that if we get backed up, we still manage to get all the // Make sure that if we get backed up, we still manage to get all the
@ -77,7 +77,7 @@ var d = 'Content-Length: 466\r\n\r\n' +
'{"seq":11,"type":"event","event":"scriptCollected","success":true,' + '{"seq":11,"type":"event","event":"scriptCollected","success":true,' +
'"body":{"script":{"id":26}},"refs":[],"running":true}'; '"body":{"script":{"id":26}},"refs":[],"running":true}';
p.execute(d); p.execute(d);
assert.equal(4, resCount); assert.strictEqual(resCount, 4);
var expectedConnections = 0; var expectedConnections = 0;
var tests = []; var tests = [];
@ -91,7 +91,7 @@ addTest(function(client, done) {
client.reqVersion(function(err, v) { client.reqVersion(function(err, v) {
assert.ok(!err); assert.ok(!err);
console.log('version: %s', v); console.log('version: %s', v);
assert.equal(process.versions.v8, v); assert.strictEqual(process.versions.v8, v);
done(); done();
}); });
}); });
@ -120,8 +120,8 @@ addTest(function(client, done) {
client.reqEval('2+2', function(err, res) { client.reqEval('2+2', function(err, res) {
console.error(res); console.error(res);
assert.ok(!err); assert.ok(!err);
assert.equal('4', res.text); assert.strictEqual(res.text, '4');
assert.equal(4, res.value); assert.strictEqual(res.value, 4);
done(); done();
}); });
}); });
@ -212,5 +212,5 @@ run();
process.on('exit', function(code) { process.on('exit', function(code) {
if (!code) if (!code)
assert.equal(expectedConnections, connectCount); assert.strictEqual(connectCount, expectedConnections);
}); });

Loading…
Cancel
Save