FedP2P/handshake_test.go

16 lines
317 B
Go
Raw Normal View History

2017-11-08 16:28:03 +08:00
package torrent
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestDefaultExtensionBytes(t *testing.T) {
pex := defaultPeerExtensionBytes()
2017-11-08 16:28:03 +08:00
assert.True(t, pex.SupportsDHT())
assert.True(t, pex.SupportsExtended())
assert.False(t, pex.GetBit(63))
assert.Panics(t, func() { pex.GetBit(64) })
2017-11-08 16:28:03 +08:00
}