Skip to content

Commit

Permalink
Aim for that last bit of code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
belak committed Aug 22, 2017
1 parent aabda25 commit d57c1b7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions client_test.go
Expand Up @@ -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
}),
})
}

0 comments on commit d57c1b7

Please sign in to comment.