1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-28 10:15:23 +00:00
v2fly/transport/internet/headers/utp/utp_test.go
2016-12-09 12:08:25 +01:00

23 lines
438 B
Go

package utp_test
import (
"testing"
"v2ray.com/core/common/buf"
"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 := buf.NewLocal(2048)
payload.AppendSupplier(utp.Write)
payload.Append(content)
assert.Int(payload.Len()).Equals(len(content) + utp.Size())
}