Condition
Expressing Assertions Using Conditions
Assertions
All links point to https://pkg.go.dev/github.com/go-openapi/testify/v2
This domain exposes 4 functionalities.
Condition
Condition uses a Comparison to assert a complex condition.
| Signature | Usage |
|---|---|
assert.Condition(t T, comp Comparison, msgAndArgs ...any) bool | package-level function |
assert.Conditionf(t T, comp Comparison, msg string, args ...any) bool | formatted variant |
assert.(*Assertions).Condition(comp Comparison) bool | method variant |
assert.(*Assertions).Conditionf(comp Comparison, msg string, args ..any) | method formatted variant |
| Signature | Usage |
|---|---|
require.Condition(t T, comp Comparison, msgAndArgs ...any) bool | package-level function |
require.Conditionf(t T, comp Comparison, msg string, args ...any) bool | formatted variant |
require.(*Assertions).Condition(comp Comparison) bool | method variant |
require.(*Assertions).Conditionf(comp Comparison, msg string, args ..any) | method formatted variant |
| Signature | Usage |
|---|---|
assertions.Condition(t T, comp Comparison, msgAndArgs ...any) bool | internal implementation |
Source: github.com/go-openapi/testify/v2/internal/assertions#Condition
Eventually
Eventually asserts that given condition will be met in waitFor time, periodically checking target function each tick.
| Signature | Usage |
|---|---|
assertions.Eventually(t T, condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...any) bool | internal implementation |
Source: github.com/go-openapi/testify/v2/internal/assertions#Eventually
EventuallyWithT
EventuallyWithT asserts that given condition will be met in waitFor time, periodically checking target function each tick. In contrast to Eventually, it supplies a CollectT to the condition function, so that the condition function can use the CollectT to call other assertions. The condition is considered “met” if no errors are raised in a tick. The supplied CollectT collects all errors from one tick (if there are any). If the condition is not met before waitFor, the collected errors of the last tick are copied to t.
Never
Never asserts that the given condition doesn’t satisfy in waitFor time, periodically checking the target function each tick.
| Signature | Usage |
|---|---|
assertions.Never(t T, condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...any) bool | internal implementation |
Source: github.com/go-openapi/testify/v2/internal/assertions#Never
Generated with github.com/go-openapi/testify/v2/codegen