Go: cmd/vendor/github.com/google/pprof/internal/proftest Index | Files

package proftest

import "cmd/vendor/github.com/google/pprof/internal/proftest"

Package proftest provides some utility routines to test other packages related to profiles.


Package Files


func Diff Uses

func Diff(b1, b2 []byte) (data []byte, err error)

Diff compares two byte arrays using the diff tool to highlight the differences. It is meant for testing purposes to display the differences between expected and actual output.

func EncodeJSON Uses

func EncodeJSON(x interface{}) []byte

EncodeJSON encodes a value into a byte array. This is intended for testing purposes.

type TestUI Uses

type TestUI struct {
    T                 *testing.T
    Ignore            int
    AllowRx           string
    NumAllowRxMatches int
    Input             []string
    // contains filtered or unexported fields

TestUI implements the plugin.UI interface, triggering test failures if more than Ignore errors not matching AllowRx are printed. Also tracks the number of times the error matches AllowRx in NumAllowRxMatches.

func (*TestUI) IsTerminal Uses

func (ui *TestUI) IsTerminal() bool

IsTerminal indicates if the UI is an interactive terminal.

func (*TestUI) Print Uses

func (ui *TestUI) Print(args ...interface{})

Print messages are discarded by the test UI.

func (*TestUI) PrintErr Uses

func (ui *TestUI) PrintErr(args ...interface{})

PrintErr messages may trigger an error failure. A fixed number of error messages are permitted when appropriate.

func (*TestUI) ReadLine Uses

func (ui *TestUI) ReadLine(_ string) (string, error)

ReadLine returns no input, as no input is expected during testing.

func (*TestUI) SetAutoComplete Uses

func (ui *TestUI) SetAutoComplete(_ func(string) string)

SetAutoComplete is not supported by the test UI.

func (*TestUI) WantBrowser Uses

func (ui *TestUI) WantBrowser() bool

WantBrowser indicates whether a browser should be opened with the -http option.

Package proftest imports 8 packages (graph). Updated 2019-06-13. Refresh now. Tools for package owners.