enmime: github.com/jhillyerd/enmime/internal/test Index | Files

package test

import "github.com/jhillyerd/enmime/internal/test"

Index

Package Files

golden.go testing.go

Variables

var PartExists = &enmime.Part{}

PartExists indicates to ComparePart that this part is expect to exist

func CompareEnvelope Uses

func CompareEnvelope(t *testing.T, got *enmime.Envelope, want *enmime.Envelope) (equal bool)

CompareEnvelope test helper compares the attributes of two envelopes, returning true if they are equal. t.Errorf() will be called for each field that is not equal. The presence of child and siblings will be checked, but not the attributes of them. Unexported fields are ignored.

func ComparePart Uses

func ComparePart(t *testing.T, got *enmime.Part, want *enmime.Part) (equal bool)

ComparePart test helper compares the attributes of two parts, returning true if they are equal. t.Errorf() will be called for each field that is not equal. The presence of child and siblings will be checked, but not the attributes of them. Header, Errors and unexported fields are ignored.

func ContentContainsString Uses

func ContentContainsString(t *testing.T, b []byte, substr string)

ContentContainsString checks if the provided readers content contains the specified substring

func ContentEqualsBytes Uses

func ContentEqualsBytes(t *testing.T, b []byte, want []byte)

ContentEqualsBytes checks if the provided readers content is the specified []byte

func ContentEqualsString Uses

func ContentEqualsString(t *testing.T, b []byte, str string)

ContentEqualsString checks if the provided readers content is the specified string

func DiffGolden Uses

func DiffGolden(t *testing.T, got []byte, path ...string)

DiffGolden does a line by comparison of got to the golden file specified by path. If the update flag is true, differing golden files will be updated with lines in got.

func DiffLines Uses

func DiffLines(t *testing.T, got []byte, want []byte)

DiffLines does a line by line comparison of got and want.

func DiffStrings Uses

func DiffStrings(t *testing.T, got []string, want []string)

DiffStrings does a entry by entry comparison of got and want.

func OpenTestData Uses

func OpenTestData(subdir, filename string) io.Reader

OpenTestData is a utility function to open a file in testdata for reading, it will panic if there is an error.

Package test imports 10 packages (graph). Updated 2019-08-31. Refresh now. Tools for package owners.