make it possible to log DATAGRAM frames

This commit is contained in:
Marten Seemann
2020-12-09 15:30:38 +07:00
parent eefd2b73f7
commit 0582228e00
5 changed files with 33 additions and 0 deletions

View File

@@ -34,6 +34,13 @@ var _ = Describe("CRYPTO frame", func() {
Expect(sf.Fin).To(BeTrue())
})
It("converts DATAGRAM frames", func() {
f := ConvertFrame(&wire.DatagramFrame{Data: []byte("foobar")})
Expect(f).To(BeAssignableToTypeOf(&logging.DatagramFrame{}))
df := f.(*logging.DatagramFrame)
Expect(df.Length).To(Equal(logging.ByteCount(6)))
})
It("converts other frames", func() {
f := ConvertFrame(&wire.MaxDataFrame{MaximumData: 1234})
Expect(f).To(BeAssignableToTypeOf(&logging.MaxDataFrame{}))