add DataLen function to StreamFrame

This commit is contained in:
Marten Seemann
2016-06-01 09:23:26 +07:00
parent 981d4e7fb8
commit 2f49a9525a
7 changed files with 38 additions and 24 deletions

View File

@@ -377,4 +377,13 @@ var _ = Describe("StreamFrame", func() {
Expect(f.getOffsetLength()).To(Equal(protocol.ByteCount(8)))
})
})
Context("DataLen", func() {
It("determines the length of the data", func() {
frame := StreamFrame{
Data: []byte("foobar"),
}
Expect(frame.DataLen()).To(Equal(protocol.ByteCount(6)))
})
})
})