File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ func TestHTTP(t *testing.T) {
25
25
err error
26
26
sendErr error
27
27
wait bool
28
+ close bool
28
29
}
29
30
30
31
tcs := []testcase {
@@ -73,7 +74,8 @@ func TestHTTP(t *testing.T) {
73
74
Reader : bytes .NewBufferString ("This is the body of the request!" ),
74
75
Closer : nopCloser {},
75
76
}, nil )}),
76
- vs : []interface {}{"i received:" , "This is the body of the request!" },
77
+ vs : []interface {}{"i received:" , "This is the body of the request!" },
78
+ close : true ,
77
79
},
78
80
}
79
81
@@ -201,6 +203,10 @@ func TestHTTP(t *testing.T) {
201
203
}
202
204
}
203
205
206
+ if tc .close && ! res .(* Response ).res .Close {
207
+ t .Error ("expected the connection to be closed by the server but it wasn't" )
208
+ }
209
+
204
210
wait , ok := getWaitChan (env )
205
211
if ! ok {
206
212
t .Fatal ("could not get wait chan" )
You can’t perform that action at this time.
0 commit comments