mirror of
https://codeberg.org/cunicu/cunicu.git
synced 2026-04-22 22:57:04 +08:00
a74df99adb
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
28 lines
379 B
Go
28 lines
379 B
Go
package wg_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
|
"riasc.eu/wice/internal/wg"
|
|
)
|
|
|
|
func TestCmpPeersEqual(t *testing.T) {
|
|
a := wgtypes.Peer{}
|
|
b := wgtypes.Peer{}
|
|
|
|
if wg.CmpPeers(&a, &a) != 0 {
|
|
t.Fail()
|
|
}
|
|
|
|
var err error
|
|
b.PublicKey, err = wgtypes.GenerateKey()
|
|
if err != nil {
|
|
t.Fail()
|
|
}
|
|
|
|
if wg.CmpPeers(&a, &b) >= 0 {
|
|
t.Fail()
|
|
}
|
|
}
|