Skip to content

Commit

Permalink
[TEST] improve respond
Browse files Browse the repository at this point in the history
  • Loading branch information
genofire committed May 19, 2019
1 parent e3024e4 commit d016969
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions respond/respond_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package respond

import (
"net"
"testing"

"github.com/stretchr/testify/assert"
)

func TestNewRespone(t *testing.T) {
assert := assert.New(t)

addr, err := net.ResolveUDPAddr("udp6", "[fe80::2]:8080")
assert.NoError(err)

data, err := NewRespone(nil, addr)
assert.NoError(err)
assert.Equal("[fe80::2]:8080", data.Address.String())
assert.Equal([]uint8{0xca, 0x2b, 0xcd, 0xc9, 0xe1, 0x2, 0x0, 0x0, 0x0, 0xff, 0xff}, data.Raw)
}

0 comments on commit d016969

Please sign in to comment.