// Copyright 2023 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn . package netpackets_test import ( "github.com/TeaOSLab/EdgeNode/internal/utils/netpackets" "github.com/iwind/TeaGo/assert" "net" "testing" ) func TestIsLocalRawIPv4(t *testing.T) { var a = assert.NewAssertion(t) a.IsTrue(netpackets.IsLocalRawIPv4(net.ParseIP("192.168.2.100").To4())) a.IsTrue(netpackets.IsLocalRawIPv4(net.ParseIP("127.0.0.1").To4())) a.IsTrue(netpackets.IsLocalRawIPv4(net.ParseIP("172.16.0.1").To4())) a.IsTrue(netpackets.IsLocalRawIPv4(net.ParseIP("10.0.0.1").To4())) a.IsFalse(netpackets.IsLocalRawIPv4(net.ParseIP("1.2.3.4").To4())) }