@@ -58,9 +58,9 @@ function test(handler, request_generator, response_validator) {
58
58
59
59
{
60
60
function handler ( req , res ) {
61
- assert . strictEqual ( '1.0' , req . httpVersion ) ;
62
- assert . strictEqual ( 1 , req . httpVersionMajor ) ;
63
- assert . strictEqual ( 0 , req . httpVersionMinor ) ;
61
+ assert . strictEqual ( req . httpVersion , '1.0' ) ;
62
+ assert . strictEqual ( req . httpVersionMajor , 1 ) ;
63
+ assert . strictEqual ( req . httpVersionMinor , 0 ) ;
64
64
res . writeHead ( 200 , { 'Content-Type' : 'text/plain' } ) ;
65
65
res . end ( body ) ;
66
66
}
@@ -72,8 +72,8 @@ function test(handler, request_generator, response_validator) {
72
72
function response_validator ( server_response , client_got_eof , timed_out ) {
73
73
const m = server_response . split ( '\r\n\r\n' ) ;
74
74
assert . strictEqual ( m [ 1 ] , body ) ;
75
- assert . strictEqual ( true , client_got_eof ) ;
76
- assert . strictEqual ( false , timed_out ) ;
75
+ assert . strictEqual ( client_got_eof , true ) ;
76
+ assert . strictEqual ( timed_out , false ) ;
77
77
}
78
78
79
79
test ( handler , request_generator , response_validator ) ;
@@ -86,9 +86,9 @@ function test(handler, request_generator, response_validator) {
86
86
//
87
87
{
88
88
function handler ( req , res ) {
89
- assert . strictEqual ( '1.0' , req . httpVersion ) ;
90
- assert . strictEqual ( 1 , req . httpVersionMajor ) ;
91
- assert . strictEqual ( 0 , req . httpVersionMinor ) ;
89
+ assert . strictEqual ( req . httpVersion , '1.0' ) ;
90
+ assert . strictEqual ( req . httpVersionMajor , 1 ) ;
91
+ assert . strictEqual ( req . httpVersionMinor , 0 ) ;
92
92
res . sendDate = false ;
93
93
res . writeHead ( 200 , { 'Content-Type' : 'text/plain' } ) ;
94
94
res . write ( 'Hello, ' ) ; res . _send ( '' ) ;
@@ -112,19 +112,19 @@ function test(handler, request_generator, response_validator) {
112
112
'\r\n' +
113
113
'Hello, world!' ;
114
114
115
- assert . strictEqual ( expected_response , server_response ) ;
116
- assert . strictEqual ( true , client_got_eof ) ;
117
- assert . strictEqual ( false , timed_out ) ;
115
+ assert . strictEqual ( server_response , expected_response ) ;
116
+ assert . strictEqual ( client_got_eof , true ) ;
117
+ assert . strictEqual ( timed_out , false ) ;
118
118
}
119
119
120
120
test ( handler , request_generator , response_validator ) ;
121
121
}
122
122
123
123
{
124
124
function handler ( req , res ) {
125
- assert . strictEqual ( '1.1' , req . httpVersion ) ;
126
- assert . strictEqual ( 1 , req . httpVersionMajor ) ;
127
- assert . strictEqual ( 1 , req . httpVersionMinor ) ;
125
+ assert . strictEqual ( req . httpVersion , '1.1' ) ;
126
+ assert . strictEqual ( req . httpVersionMajor , 1 ) ;
127
+ assert . strictEqual ( req . httpVersionMinor , 1 ) ;
128
128
res . sendDate = false ;
129
129
res . writeHead ( 200 , { 'Content-Type' : 'text/plain' } ) ;
130
130
res . write ( 'Hello, ' ) ; res . _send ( '' ) ;
@@ -155,9 +155,9 @@ function test(handler, request_generator, response_validator) {
155
155
'0\r\n' +
156
156
'\r\n' ;
157
157
158
- assert . strictEqual ( expected_response , server_response ) ;
159
- assert . strictEqual ( true , client_got_eof ) ;
160
- assert . strictEqual ( false , timed_out ) ;
158
+ assert . strictEqual ( server_response , expected_response ) ;
159
+ assert . strictEqual ( client_got_eof , true ) ;
160
+ assert . strictEqual ( timed_out , false ) ;
161
161
}
162
162
163
163
test ( handler , request_generator , response_validator ) ;
0 commit comments