package assert
import "github.com/docker/docker/pkg/testutil/assert"
Package assert contains functions for making assertions in unit tests
Index ¶
- func Contains(t TestingT, actual, contains string)
- func Equal(t TestingT, actual, expected interface{})
- func EqualStringSlice(t TestingT, actual, expected []string)
- func Error(t TestingT, err error, contains string)
- func NilError(t TestingT, err error)
- type TestingT
Functions ¶
func Contains ¶
Contains asserts that the string contains a substring, otherwise it fails the test.
func Equal ¶
func Equal(t TestingT, actual, expected interface{})
Equal compare the actual value to the expected value and fails the test if they are not equal.
func EqualStringSlice ¶
EqualStringSlice compares two slices and fails the test if they do not contain the same items.
func Error ¶
Error asserts that error is not nil, and contains the expected text, otherwise it fails the test.
func NilError ¶
NilError asserts that the error is nil, otherwise it fails the test.
Types ¶
type TestingT ¶
type TestingT interface { Fatalf(string, ...interface{}) }
TestingT is an interface which defines the methods of testing.T that are required by this package
Source Files ¶
- Version
- v1.12.2-rc1
- Published
- Sep 27, 2016
- Platform
- js/wasm
- Imports
- 4 packages
- Last checked
- 3 minutes ago –
Tools for package owners.