require

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2020 License: MPL-2.0, MPL-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirsMatch

func DirsMatch(t *testing.T, expectedName, actualName string, lrs ...ReaderLineReplacer)

func FileStringContains

func FileStringContains(t *testing.T, name string, expected ...string)

func FilesMatch

func FilesMatch(t *testing.T, expectedName, actualName string, lrs ...ReaderLineReplacer)

func MatchRegexp

func MatchRegexp(t *testing.T, subject string, expectedReStr ...string)

func ReaderStringContains

func ReaderStringContains(t *testing.T, r io.Reader, expected ...string)

func ReadersMatch

func ReadersMatch(t *testing.T, expectedName string, expected io.Reader, actualName string, actual io.Reader, lrs ...ReaderLineReplacer)

func StringContains

func StringContains(t *testing.T, subject string, expected ...string)

func StringSliceExactly

func StringSliceExactly(t *testing.T, expected []string, actual []string)

func StringSortedSliceExactly

func StringSortedSliceExactly(t *testing.T, expected []string, actual []string)

Types

type ReaderLineReplacer

type ReaderLineReplacer func(expectedName, actualName, actualLine string) (replacement string)

ReaderLineReplacer receives an "actual" line, from an expected vs. actual test comparison, and optionally returns a new "actual" line value.

For example, if the actual values will change over time (e.g. "go <semver>" strings in new go.mod files), a ReaderLineReplacer can allow test fixtures to have out-dated semver values (which are not the SUT) by replacing the dynamic value with the expected static value.

The expectedName and actualName values are the reader (e.g. file) names.

Jump to

Keyboard shortcuts

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