package ip import ( "context" "net" "os" "testing" "gotest.tools/v3/assert" "edge-infra.dev/test/f2" ) var f f2.Framework func TestMain(m *testing.M) { f = f2.New(context.Background(), f2.WithExtensions()). Setup(). Teardown() os.Exit(f.Run(m)) } func TestConvertIPToUint32(t *testing.T) { feature := f2.NewFeature("convert ip to uint32"). Test("convert ip to uint32", func(ctx f2.Context, t *testing.T) f2.Context { ip, _, err := net.ParseCIDR("10.10.12.1/32") assert.NilError(t, err) unsignedInt := IPv4ToUInt32(ip) assert.Equal(t, uint32(168430593), unsignedInt) return ctx }).Feature() f.Test(t, feature) }