test

package
v0.0.0-...-9d33ba6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PartExists = &enmime.Part{}

Syntatic sugar for Part comparisons

Functions

func ComparePart

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

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

ContentContainsString checks if the provided readers content contains the specified substring

func ContentEqualsBytes

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

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

func ContentEqualsString

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

ContentEqualsString checks if the provided readers content is the specified string

func OpenTestData

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.

func TestHelperComparePartsEqual

func TestHelperComparePartsEqual(t *testing.T)

TestHelperComparePartsEqual tests compareParts with equalivent Parts

func TestHelperComparePartsInequal

func TestHelperComparePartsInequal(t *testing.T)

TestHelperComparePartsInequal tests compareParts with differing Parts

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL