implement Timeout() for QuicError

This commit is contained in:
Phus Lu
2017-06-20 13:51:45 +08:00
parent 472f2b24c0
commit 13abf7800f
2 changed files with 17 additions and 0 deletions

View File

@@ -22,6 +22,13 @@ var _ = Describe("Quic error", func() {
})
})
Context("TimeoutError", func() {
It("works as timeout error", func() {
err := Error(HandshakeTimeout, "handshake timeout")
Expect(err.Timeout()).Should(BeTrue())
})
})
Context("ToQuicError", func() {
It("leaves QuicError unchanged", func() {
err := Error(DecryptionFailure, "foo")