Discover Packages
github.com/rotationalio/confire
assert
package
Version:
v1.1.0
Opens a new window with list of versions in this module.
Published: Aug 19, 2024
License: BSD-3-Clause
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Jump to ...
Documentation
Overview
Index
Constants
Variables
Functions
Assert(tb, condition, msg, v)
Equals(tb, exp, act)
ErrorIs(tb, err, target)
False(tb, condition)
Ok(tb, err)
True(tb, condition)
Types
Source Files
Documentation
Documentation
¶
Assertion Helpers
Because this is a library, we prefer to have no dependencies including our usual test
dependencies (e.g. testify require). So we have some basic assertion helpers for tests.
See: https://github.com/benbjohnson/testing
func Assert(tb testing.TB, condition bool, msg string, v ...interface{})
func Equals(tb testing.TB, exp, act interface{})
func ErrorIs(tb testing.TB, err, target error)
func False(tb testing.TB, condition bool)
func Ok(tb testing.TB, err error)
func True(tb testing.TB, condition bool)
type BoolAssertion
Assert fails the test if the condition is false.
func Equals(tb testing .TB , exp, act interface{})
Equals fails the test if exp (expected) is not equal to act (actual).
ErrorIs fails the test if the err does not match the target.
False asserts that the condition is false.
Ok fails the test if an err is not nil.
True asserts that the condition is true.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.