| 1 | package udp |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/stretchr/testify/require" |
| 7 | ) |
| 8 | |
| 9 | func TestUdpPacket(t *testing.T) { |
| 10 | require := require.New(t) |
| 11 | |
| 12 | buf := []byte("hello world") |
| 13 | udpMsg := NewUDPPacket(buf, nil, nil) |
| 14 | |
| 15 | newBuf, err := GetContent(udpMsg) |
| 16 | require.NoError(err) |
| 17 | require.EqualValues(buf, newBuf) |
| 18 | } |