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:
22
transport/internet/kcp/crypt_test.go
Normal file
22
transport/internet/kcp/crypt_test.go
Normal 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")
|
||||
}
|
||||
Reference in New Issue
Block a user