github.com/slackhq/nebula@v1.9.0/iputil/util_test.go (about) 1 package iputil 2 3 import ( 4 "net" 5 "testing" 6 7 "github.com/stretchr/testify/assert" 8 ) 9 10 func TestVpnIp_String(t *testing.T) { 11 assert.Equal(t, "255.255.255.255", Ip2VpnIp(net.ParseIP("255.255.255.255")).String()) 12 assert.Equal(t, "1.255.255.255", Ip2VpnIp(net.ParseIP("1.255.255.255")).String()) 13 assert.Equal(t, "1.1.255.255", Ip2VpnIp(net.ParseIP("1.1.255.255")).String()) 14 assert.Equal(t, "1.1.1.255", Ip2VpnIp(net.ParseIP("1.1.1.255")).String()) 15 assert.Equal(t, "1.1.1.1", Ip2VpnIp(net.ParseIP("1.1.1.1")).String()) 16 assert.Equal(t, "0.0.0.0", Ip2VpnIp(net.ParseIP("0.0.0.0")).String()) 17 }