buf: github.com/bufbuild/buf/internal/pkg/prototesting Index | Files

package prototesting

import "github.com/bufbuild/buf/internal/pkg/prototesting"

Index

Package Files

prototesting.go

func AssertFileDescriptorSetsEqual Uses

func AssertFileDescriptorSetsEqual(t *testing.T, one *descriptorpb.FileDescriptorSet, two *descriptorpb.FileDescriptorSet)

AssertFileDescriptorSetsEqual asserts that the FileDescriptorSet are equal for JSON and compare.

func DiffFileDescriptorSetsCompare Uses

func DiffFileDescriptorSetsCompare(
    one *descriptorpb.FileDescriptorSet,
    two *descriptorpb.FileDescriptorSet,
) string

DiffFileDescriptorSetsCompare diffs the two FileDescriptorSets using the cmp package.

func DiffFileDescriptorSetsJSON Uses

func DiffFileDescriptorSetsJSON(
    ctx context.Context,
    one *descriptorpb.FileDescriptorSet,
    two *descriptorpb.FileDescriptorSet,
    oneName string,
    twoName string,
) (string, error)

DiffFileDescriptorSetsJSON diffs the two FileDescriptorSets using JSON.

func DiffFileDescriptorSetsWire Uses

func DiffFileDescriptorSetsWire(
    ctx context.Context,
    one *descriptorpb.FileDescriptorSet,
    two *descriptorpb.FileDescriptorSet,
    oneName string,
    twoName string,
) (string, error)

DiffFileDescriptorSetsWire diffs the two FileDescriptorSets using proto.MarshalWire.

func GetProtocFileDescriptorSet Uses

func GetProtocFileDescriptorSet(
    ctx context.Context,
    roots []string,
    realFilePaths []string,
    includeImports bool,
    includeSourceInfo bool,
    experimentalAllowProto3Optional bool,
) (_ *descriptorpb.FileDescriptorSet, retErr error)

GetProtocFileDescriptorSet gets the validated FileDescriptorSet using protoc and the Well-Known Types on the current PATH.

Only use for testing.

func RunProtoc Uses

func RunProtoc(
    ctx context.Context,
    roots []string,
    realFilePaths []string,
    includeImports bool,
    includeSourceInfo bool,
    experimentalAllowProto3Optional bool,
    env map[string]string,
    stdout io.Writer,
    extraFlags ...string,
) error

RunProtoc runs protoc.

Package prototesting imports 15 packages (graph) and is imported by 1 packages. Updated 2020-07-17. Refresh now. Tools for package owners.