frp/pkg/proto/udp/udp_test.go
2025-05-26 14:54:03 +08:00

19 lines
302 B
Go

package udp
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestUdpPacket(t *testing.T) {
require := require.New(t)
buf := []byte("hello world")
udpMsg := NewUDPPacket(buf, nil, nil)
newBuf, err := GetContent(udpMsg)
require.NoError(err)
require.EqualValues(buf, newBuf)
}