Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: don't check the # of chunks in test-http-1.0 #3961

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions test/parallel/test-http-1.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ function test(handler, request_generator, response_validator) {
var server = http.createServer(handler);

var client_got_eof = false;
var server_response = {
data: '',
chunks: []
};
var server_response = '';

function cleanup() {
server.close();
Expand All @@ -36,8 +33,7 @@ function test(handler, request_generator, response_validator) {
});

c.on('data', function(chunk) {
server_response.data += chunk;
server_response.chunks.push(chunk);
server_response += chunk;
});

c.on('end', function() {
Expand Down Expand Up @@ -65,7 +61,7 @@ function test(handler, request_generator, response_validator) {
}

function response_validator(server_response, client_got_eof, timed_out) {
var m = server_response.data.split('\r\n\r\n');
var m = server_response.split('\r\n\r\n');
assert.equal(m[1], body);
assert.equal(true, client_got_eof);
assert.equal(false, timed_out);
Expand Down Expand Up @@ -107,8 +103,7 @@ function test(handler, request_generator, response_validator) {
'\r\n' +
'Hello, world!');

assert.equal(expected_response, server_response.data);
assert.equal(1, server_response.chunks.length);
assert.equal(expected_response, server_response);
assert.equal(true, client_got_eof);
assert.equal(false, timed_out);
}
Expand Down Expand Up @@ -151,8 +146,7 @@ function test(handler, request_generator, response_validator) {
'0\r\n' +
'\r\n');

assert.equal(expected_response, server_response.data);
assert.equal(1, server_response.chunks.length);
assert.equal(expected_response, server_response);
assert.equal(true, client_got_eof);
assert.equal(false, timed_out);
}
Expand Down