protobufgoogle.golang.org/protobuf/testing/prototest Index | Files

package prototest

import "google.golang.org/protobuf/testing/prototest"

Package prototest exercises protobuf reflection.

Index

Types

type Enum

type Enum struct{}

Enum tests an protoreflect.EnumType implementation.

func (Enum) Test

func (test Enum) Test(t testing.TB, et protoreflect.EnumType)

type Message

type Message struct {
	// Resolver is used to determine the list of extension fields to test with.
	// If nil, this defaults to using protoregistry.GlobalTypes.
	Resolver interface {
		FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error)
		FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error)
		RangeExtensionsByMessage(message protoreflect.FullName, f func(protoreflect.ExtensionType) bool)
	}

	// UnmarshalOptions are respected for every Unmarshal call this package
	// does. The Resolver and AllowPartial fields are overridden.
	UnmarshalOptions proto.UnmarshalOptions
}

Message tests a message implementation.

func (Message) Test

func (test Message) Test(t testing.TB, mt protoreflect.MessageType)

Test performs tests on a protoreflect.MessageType implementation.

Source Files

enum.go message.go

Version
v1.36.5 (latest)
Published
Feb 6, 2025
Platform
linux/amd64
Imports
12 packages
Last checked
4 hours ago

Tools for package owners.