github.com/tumi8/quic-go@v0.37.4-tum/noninternal/utils/ip_test.go (about) 1 package utils 2 3 import ( 4 "net" 5 6 . "github.com/onsi/ginkgo/v2" 7 . "github.com/onsi/gomega" 8 ) 9 10 var _ = Describe("IP", func() { 11 It("tells IPv4 and IPv6 addresses apart", func() { 12 Expect(IsIPv4(net.IPv4(127, 0, 0, 1))).To(BeTrue()) 13 Expect(IsIPv4(net.IPv4zero)).To(BeTrue()) 14 Expect(IsIPv4(net.IPv6zero)).To(BeFalse()) 15 Expect(IsIPv4(net.IPv6loopback)).To(BeFalse()) 16 }) 17 })