package
Version:
v2.0.2-0...-0d99925
Opens a new window with list of versions in this module.
Published: Mar 31, 2020
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package assert is a helper package for test assertions.
On failure, every assertion will fatal the test.
The name parameter is available in each assertion for easier debugging.
-
func Equal(t testing.TB, name string, exp, act interface{}, opts ...cmp.Option)
-
func Error(t testing.TB, name string, err error)
-
func ErrorContains(t testing.TB, name string, err error, sub string)
-
func Success(t testing.TB, name string, err error)
-
func True(t testing.TB, name string, act bool)
Equal asserts exp == act.
If they are not equal, it will fatal the test with a diff of the
two objects.
Errors will be compared with errors.Is.
Error asserts err != nil.
ErrorContains asserts err != nil and err.Error() contains sub.
The match will be case insensitive.
Success asserts err == nil.
True asserts act == true.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.