Documentation ¶
Index ¶
- Variables
- func ComparePart(t *testing.T, got *enmime.Part, want *enmime.Part) (equal bool)
- func ContentContainsString(t *testing.T, b []byte, substr string)
- func ContentEqualsBytes(t *testing.T, b []byte, want []byte)
- func ContentEqualsString(t *testing.T, b []byte, str string)
- func DiffGolden(t *testing.T, got []byte, path ...string)
- func DiffLines(t *testing.T, got []byte, want []byte)
- func DiffStrings(t *testing.T, got []string, want []string)
- func OpenTestData(subdir, filename string) io.Reader
Constants ¶
This section is empty.
Variables ¶
var PartExists = &enmime.Part{}
PartExists indicates to ComparePart that this part is expect to exist
Functions ¶
func ComparePart ¶
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 ¶
ContentContainsString checks if the provided readers content contains the specified substring
func ContentEqualsBytes ¶
ContentEqualsBytes checks if the provided readers content is the specified []byte
func ContentEqualsString ¶
ContentEqualsString checks if the provided readers content is the specified string
func DiffGolden ¶
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 DiffStrings ¶
DiffStrings does a entry by entry comparison of got and want.
func OpenTestData ¶
OpenTestData is a utility function to open a file in testdata for reading, it will panic if there is an error.
Types ¶
This section is empty.