1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-05-19 10:49:07 -04:00

Integrate kcp with other components

This commit is contained in:
v2ray
2016-06-17 16:51:41 +02:00
parent e5394cdaa0
commit 42ae2d804f
8 changed files with 665 additions and 804 deletions

View File

@@ -0,0 +1,22 @@
package kcp_test
import (
"testing"
"github.com/v2ray/v2ray-core/common/alloc"
"github.com/v2ray/v2ray-core/testing/assert"
. "github.com/v2ray/v2ray-core/transport/internet/kcp"
)
func TestSimpleAuthenticator(t *testing.T) {
assert := assert.On(t)
buffer := alloc.NewBuffer().Clear()
buffer.AppendBytes('a', 'b', 'c', 'd', 'e', 'f', 'g')
auth := NewSimpleAuthenticator()
auth.Seal(buffer)
assert.Bool(auth.Open(buffer)).IsTrue()
assert.String(buffer.String()).Equals("abcdefg")
}