add a test that the framer does not emit empty frames

fixes #202
This commit is contained in:
Lucas Clemente
2016-07-28 17:02:06 +02:00
parent 3d0ed0d1f9
commit f6b6566c65

View File

@@ -109,6 +109,16 @@ var _ = Describe("Stream Framer", func() {
Expect(framer.PopStreamFrames(1000)).To(BeEmpty()) Expect(framer.PopStreamFrames(1000)).To(BeEmpty())
}) })
It("does not pop empty frames", func() {
stream1.dataForWriting = []byte("foobar")
fs := framer.PopStreamFrames(4)
Expect(fs).To(HaveLen(0))
fs = framer.PopStreamFrames(5)
Expect(fs).To(HaveLen(1))
Expect(fs[0].Data).ToNot(BeEmpty())
Expect(fs[0].FinBit).To(BeFalse())
})
Context("splitting of frames", func() { Context("splitting of frames", func() {
It("splits off nothing", func() { It("splits off nothing", func() {
f := &frames.StreamFrame{ f := &frames.StreamFrame{