neo-go/pkg/services/oracle/network_test.go

19 lines
435 B
Go
Raw Normal View History

2020-09-25 14:39:11 +00:00
package oracle
import (
"net"
"testing"
"github.com/stretchr/testify/require"
)
func TestIsReserved(t *testing.T) {
require.True(t, isReserved(net.IPv4zero))
require.True(t, isReserved(net.IPv4(10, 0, 0, 1)))
require.True(t, isReserved(net.IPv4(192, 168, 0, 1)))
require.True(t, isReserved(net.IPv6interfacelocalallnodes))
require.True(t, isReserved(net.IPv6loopback))
require.False(t, isReserved(net.IPv4(8, 8, 8, 8)))
}