◐ Shell
clean mode source ↗

test: reduce number of written chunks · nodejs/node@12744c1

Original file line numberDiff line numberDiff line change

@@ -55,10 +55,12 @@ server.listen(0, common.mustCall(() => {

5555
5656

sendDelayedRequestHeaders = common.mustCall(() => {

5757

setTimeout(() => {

58-

client.write('POST / HTTP/1.1\r\n');

59-

client.write('Content-Length: 20\r\n');

60-

client.write('Connection: close\r\n\r\n');

61-

client.write('12345678901234567890\r\n\r\n');

58+

client.write(

59+

'POST / HTTP/1.1\r\n' +

60+

'Content-Length: 20\r\n' +

61+

'Connection: close\r\n\r\n' +

62+

'12345678901234567890\r\n\r\n'

63+

);

6264

}, common.platformTimeout(headersTimeout * 2)).unref();

6365

});

6466

}));

Original file line numberDiff line numberDiff line change

@@ -52,9 +52,11 @@ server.listen(0, common.mustCall(() => {

5252

}));

5353
5454

client.resume();

55-

client.write('GET / HTTP/1.1\r\n');

56-

client.write('Connection: close\r\n');

57-

client.write('X-CRASH: ');

55+

client.write(

56+

'GET / HTTP/1.1\r\n' +

57+

'Connection: close\r\n' +

58+

'X-CRASH: '

59+

);

5860
5961

sendDelayedRequestHeaders = common.mustCall(() => {

6062

setTimeout(() => {

Original file line numberDiff line numberDiff line change

@@ -59,11 +59,12 @@ server.listen(0, common.mustCall(() => {

5959

}));

6060
6161

client.resume();

62-

client.write('POST / HTTP/1.1\r\n');

63-

client.write('Host: example.com\r\n');

64-

client.write('Content-Length: 20\r\n');

65-

client.write('Connection: close\r\n');

66-

client.write('\r\n');

62+

client.write(

63+

'POST / HTTP/1.1\r\n' +

64+

'Host: example.com\r\n' +

65+

'Content-Length: 20\r\n' +

66+

'Connection: close\r\n\r\n'

67+

);

6768
6869

sendDelayedRequestBody = common.mustCall(() => {

6970

setTimeout(() => {

Original file line numberDiff line numberDiff line change

@@ -50,10 +50,12 @@ server.listen(0, common.mustCall(() => {

5050
5151

sendDelayedRequestHeaders = common.mustCall(() => {

5252

setTimeout(() => {

53-

client.write('POST / HTTP/1.1\r\n');

54-

client.write('Content-Length: 20\r\n');

55-

client.write('Connection: close\r\n\r\n');

56-

client.write('12345678901234567890\r\n\r\n');

53+

client.write(

54+

'POST / HTTP/1.1\r\n' +

55+

'Content-Length: 20\r\n' +

56+

'Connection: close\r\n\r\n' +

57+

'12345678901234567890\r\n\r\n'

58+

);

5759

}, common.platformTimeout(requestTimeout * 2)).unref();

5860

});

5961

}));

Original file line numberDiff line numberDiff line change

@@ -59,12 +59,13 @@ server.listen(0, common.mustCall(() => {

5959

}));

6060
6161

client.resume();

62-

client.write('POST / HTTP/1.1\r\n');

63-

client.write('Host: example.com\r\n');

64-

client.write('Content-Length: 20\r\n');

65-

client.write('Connection: close\r\n');

66-

client.write('\r\n');

67-

client.write('1234567890');

62+

client.write(

63+

'POST / HTTP/1.1\r\n' +

64+

'Host: example.com\r\n' +

65+

'Content-Length: 20\r\n' +

66+

'Connection: close\r\n\r\n' +

67+

'1234567890'

68+

);

6869
6970

sendDelayedRequestBody = common.mustCall(() => {

7071

setTimeout(() => {

Original file line numberDiff line numberDiff line change

@@ -47,9 +47,11 @@ server.listen(0, common.mustCall(() => {

4747

}));

4848
4949

client.resume();

50-

client.write('GET / HTTP/1.1\r\n');

51-

client.write('Connection: close\r\n');

52-

client.write('X-CRASH: ');

50+

client.write(

51+

'GET / HTTP/1.1\r\n' +

52+

'Connection: close\r\n' +

53+

'X-CRASH: '

54+

);

5355
5456

sendDelayedRequestHeaders = common.mustCall(() => {

5557

setTimeout(() => {