1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-26 13:56:12 -04:00
v2fly/transport/internet/headers/utp/utp_test.go
2016-12-08 16:27:41 +01:00

23 lines
444 B
Go

package utp_test
import (
"testing"
"v2ray.com/core/common/alloc"
"v2ray.com/core/testing/assert"
. "v2ray.com/core/transport/internet/headers/utp"
)
func TestUTPWrite(t *testing.T) {
assert := assert.On(t)
content := []byte{'a', 'b', 'c', 'd', 'e', 'f', 'g'}
utp := UTP{}
payload := alloc.NewLocalBuffer(2048)
payload.AppendFunc(utp.Write)
payload.Append(content)
assert.Int(payload.Len()).Equals(len(content) + utp.Size())
}