1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-11-23 12:02:58 -05:00
Files
v2fly/transport/internet/headers/utp/utp_test.go

23 lines
438 B
Go
Raw Normal View History

2016-08-08 21:23:07 +02:00
package utp_test
import (
"testing"
2016-12-09 11:35:27 +01:00
"v2ray.com/core/common/buf"
2016-08-20 20:55:45 +02:00
"v2ray.com/core/testing/assert"
2016-12-08 16:27:41 +01:00
. "v2ray.com/core/transport/internet/headers/utp"
2016-08-08 21:23:07 +02:00
)
2016-12-08 16:27:41 +01:00
func TestUTPWrite(t *testing.T) {
2016-08-08 21:23:07 +02:00
assert := assert.On(t)
content := []byte{'a', 'b', 'c', 'd', 'e', 'f', 'g'}
2016-12-08 16:27:41 +01:00
utp := UTP{}
2016-12-09 12:08:25 +01:00
payload := buf.NewLocal(2048)
payload.AppendSupplier(utp.Write)
2016-12-06 11:03:42 +01:00
payload.Append(content)
2016-12-08 16:27:41 +01:00
assert.Int(payload.Len()).Equals(len(content) + utp.Size())
2016-08-08 21:23:07 +02:00
}