File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -261,4 +261,34 @@ func TestPingLoop(t *testing.T) {
261
261
lastPing = m
262
262
}),
263
263
})
264
+
265
+ // This one is just for coverage, so we know we're hitting the
266
+ // branch that drops extra pings.
267
+ config .PingFrequency = 5 * time .Millisecond
268
+ config .PingTimeout = 50 * time .Millisecond
269
+ runTest (t , config , io .EOF , []TestAction {
270
+ ExpectLine ("PASS :test_pass\r \n " ),
271
+ ExpectLine ("NICK :test_nick\r \n " ),
272
+ ExpectLine ("USER test_user 0.0.0.0 0.0.0.0 :test_name\r \n " ),
273
+ SendLine ("001 :hello_world\r \n " ),
274
+ Delay (30 * time .Millisecond ),
275
+ LineFunc (func (m * Message ) {
276
+ lastPing = m
277
+ }),
278
+ LineFunc (func (m * Message ) {
279
+ lastPing = m
280
+ }),
281
+ LineFunc (func (m * Message ) {
282
+ lastPing = m
283
+ }),
284
+ LineFunc (func (m * Message ) {
285
+ lastPing = m
286
+ }),
287
+ LineFunc (func (m * Message ) {
288
+ lastPing = m
289
+ }),
290
+ LineFunc (func (m * Message ) {
291
+ lastPing = m
292
+ }),
293
+ })
264
294
}
You can’t perform that action at this time.
0 commit comments