diff --git a/client_test.go b/client_test.go index c53bb79..69d9dca 100644 --- a/client_test.go +++ b/client_test.go @@ -261,4 +261,19 @@ func TestPingLoop(t *testing.T) { lastPing = m }), }) + + // This one is just for coverage, so we know we're hitting the + // branch that drops extra pings. + config.PingFrequency = 10 * time.Millisecond + config.PingTimeout = 100 * time.Millisecond + runTest(t, config, io.EOF, []TestAction{ + ExpectLine("PASS :test_pass\r\n"), + ExpectLine("NICK :test_nick\r\n"), + ExpectLine("USER test_user 0.0.0.0 0.0.0.0 :test_name\r\n"), + SendLine("001 :hello_world\r\n"), + Delay(65 * time.Millisecond), + LineFunc(func(m *Message) { + lastPing = m + }), + }) }