1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-19 10:56:06 -05: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())
}