MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / TestIsIPv6

Function TestIsIPv6

internal/utils/ip_test.go:33–43  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

31}
32
33func TestIsIPv6(t *testing.T) {
34 var a = assert.NewAssertion(t)
35 a.IsFalse(utils.IsIPv6("192.168.1.1"))
36 a.IsFalse(utils.IsIPv6("0.0.0.0"))
37 a.IsFalse(utils.IsIPv6("192.168.1.256"))
38 a.IsFalse(utils.IsIPv6("192.168.1"))
39 a.IsTrue(utils.IsIPv6("::1"))
40 a.IsTrue(utils.IsIPv6("2001:0db8:85a3:0000:0000:8a2e:0370:7334"))
41 a.IsFalse(utils.IsIPv4("::ffff:192.168.0.1"))
42 a.IsTrue(utils.IsIPv6("::ffff:192.168.0.1"))
43}
44
45func TestIsWildIP(t *testing.T) {
46 var a = assert.NewAssertion(t)

Callers

nothing calls this directly

Calls 2

IsIPv6Function · 0.92
IsIPv4Function · 0.92

Tested by

no test coverage detected