| 1 |
## Possible things to do |
| 2 |
|
| 3 |
var defaultRetryStrategy = &retry.Strategy{ |
| 4 |
Delay: time.Millisecond, |
| 5 |
MaxDelay: 200 * time.Millisecond, |
| 6 |
MaxDuration: 5 * time.Second |
| 7 |
} |
| 8 |
|
| 9 |
var defaultStableStrategy = &retry.Strategy{ |
| 10 |
Delay: time.Millisecond, |
| 11 |
MaxDuration: 50 * time.Millisecond, |
| 12 |
} |
| 13 |
|
| 14 |
func Eventually[T any](f func() T, checker func(T) Checker, retry *retry.Strategy) Checker |
| 15 |
func EventuallyStable[T any](f func() T, checker func(T) Checker, retry, stableRetry *retry.Strategy) Checker |
| 16 |
|
| 17 |
// QT provides a version of the Assert and Check primitives |
| 18 |
// that use a customizable Format function. |
| 19 |
// |
| 20 |
// For example: |
| 21 |
// |
| 22 |
// package mypackage |
| 23 |
// |
| 24 |
// import _qt "github.com/go-quicktest/qt" |
| 25 |
// |
| 26 |
// var qt = _qt.QT{ |
| 27 |
// Format: myFormat, |
| 28 |
// } |
| 29 |
type QT struct { |
| 30 |
Format func(interface{}) string |
| 31 |
} |
| 32 |
|
| 33 |
func (qt QT) Assert(t testing.TB, checker Checker, comment ...Comment) |
| 34 |
func (qt QT) Check(t testing.TB, checker Checker, comment ...Comment) bool |
| 35 |
|