mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-08 21:02:33 +08:00
添加 github.com/pion/dtls 代码
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package extension
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/pion/dtls/v2/pkg/crypto/elliptic"
|
||||
)
|
||||
|
||||
func TestExtensionSupportedGroups(t *testing.T) {
|
||||
rawSupportedGroups := []byte{0x0, 0xa, 0x0, 0x4, 0x0, 0x2, 0x0, 0x1d}
|
||||
parsedSupportedGroups := &SupportedEllipticCurves{
|
||||
EllipticCurves: []elliptic.Curve{elliptic.X25519},
|
||||
}
|
||||
|
||||
raw, err := parsedSupportedGroups.Marshal()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
} else if !reflect.DeepEqual(raw, rawSupportedGroups) {
|
||||
t.Errorf("extensionSupportedGroups marshal: got %#v, want %#v", raw, rawSupportedGroups)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user