1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-11-23 12:02:58 -05:00

remove dep on assert lib

This commit is contained in:
Darien Raymond
2019-02-02 22:19:30 +01:00
parent 2a0f3591f4
commit bdd71a44b4
35 changed files with 365 additions and 324 deletions

View File

@@ -9,7 +9,6 @@ import (
"v2ray.com/core/common"
. "v2ray.com/core/proxy/mtproto"
. "v2ray.com/ext/assert"
)
func TestInverse(t *testing.T) {
@@ -31,15 +30,24 @@ func TestInverse(t *testing.T) {
}
func TestAuthenticationReadWrite(t *testing.T) {
assert := With(t)
a := NewAuthentication(DefaultSessionContext())
b := bytes.NewReader(a.Header[:])
a2, err := ReadAuthentication(b)
assert(err, IsNil)
common.Must(err)
assert(a.EncodingKey[:], Equals, a2.DecodingKey[:])
assert(a.EncodingNonce[:], Equals, a2.DecodingNonce[:])
assert(a.DecodingKey[:], Equals, a2.EncodingKey[:])
assert(a.DecodingNonce[:], Equals, a2.EncodingNonce[:])
if r := cmp.Diff(a.EncodingKey[:], a2.DecodingKey[:]); r != "" {
t.Error("decoding key: ", r)
}
if r := cmp.Diff(a.EncodingNonce[:], a2.DecodingNonce[:]); r != "" {
t.Error("decoding nonce: ", r)
}
if r := cmp.Diff(a.DecodingKey[:], a2.EncodingKey[:]); r != "" {
t.Error("encoding key: ", r)
}
if r := cmp.Diff(a.DecodingNonce[:], a2.EncodingNonce[:]); r != "" {
t.Error("encoding nonce: ", r)
}
}