Documentation ¶
Index ¶
- Constants
- Variables
- func ExtractSameValue(t T, v any) (any, bool)
- func ExtractorUnsupported(t T, v any) (any, bool)
- func GetHelper(t T) interface{ ... }
- func GetRoot(t T) *testing.T
- type Asserter
- type Assertion
- type Comparator
- type Ensurer
- type EqualToMatcher
- type Extractor
- type HasParent
- type Location
- type Matcher
- func BeBetween(min, max any) Matcher
- func BeEmpty() Matcher
- func BeGreaterThan(min any) Matcher
- func BeLessThan(max any) Matcher
- func BeNil() Matcher
- func Fail(patterns ...string) Matcher
- func Not(m Matcher) Matcher
- func Say[Type string | *regexp.Regexp](expectation Type) Matcher
- func Succeed() Matcher
- type MatcherFunc
- type T
- type ValueExtractor
- type VerifyOrEnsure
Constants ¶
View Source
const SlowFactorEnvVarName = "JUSTEST_SLOW_FACTOR"
Variables ¶
View Source
var (
NumericValueExtractor = NewNumericValueExtractor()
)
Functions ¶
Types ¶
type Assertion ¶
type Assertion interface { // Now will perform the assertion and fail immediately if it mismatches. Now() // Deprecated: OrFail is a synonym for Now. OrFail() // For will continually perform the assertion until the given duration has passed or until it mismatches. If it // mismatched once, the assertion is considered failed. For(duration time.Duration, interval time.Duration) // Within will continually perform the assertion until the given duration has passed or until it successfully // matches. If the duration has passed without any successful matches, the assertion is considered failed. Within(duration time.Duration, interval time.Duration) }
type Comparator ¶
type EqualToMatcher ¶
type EqualToMatcher interface { Matcher Using(comparator Comparator) EqualToMatcher }
func EqualTo ¶
func EqualTo(expected ...any) EqualToMatcher
type Extractor ¶
func NewChannelExtractor ¶
func NewChannelExtractor(ve ValueExtractor, recurse bool) Extractor
func NewFuncExtractor ¶
func NewFuncExtractor(ve ValueExtractor, recurse bool) Extractor
func NewPointerExtractor ¶
func NewPointerExtractor(ve ValueExtractor, recurse bool) Extractor
type MatcherFunc ¶
func (MatcherFunc) Assert ¶
func (f MatcherFunc) Assert(t T, actuals ...any)
type ValueExtractor ¶
func NewNumericValueExtractor ¶
func NewNumericValueExtractor() ValueExtractor
func NewValueExtractor ¶
func NewValueExtractor(defaultExtractor Extractor) ValueExtractor
func NewValueExtractorWithMap ¶
func NewValueExtractorWithMap(defaultExtractor Extractor, extractors map[reflect.Kind]Extractor) ValueExtractor
func (ValueExtractor) ExtractValue ¶
func (ve ValueExtractor) ExtractValue(t T, actual any) (any, bool)
func (ValueExtractor) MustExtractValue ¶
func (ve ValueExtractor) MustExtractValue(t T, actual any) any
type VerifyOrEnsure ¶ added in v0.7.0
type VerifyOrEnsure interface { // EnsureThat adds a description to the upcoming assertion, which will be printed in case it fails. EnsureThat(string, ...any) Ensurer // Deprecated: Ensure is a synonym for EnsureThat. Ensure(string, ...any) Ensurer // VerifyThat starts an assertion without a description. VerifyThat(actuals ...any) Asserter // Deprecated: Verify is a synonym for VerifyThat. Verify(actuals ...any) Asserter }
func With ¶
func With(t T) VerifyOrEnsure
Source Files ¶
- asserter.go
- location.go
- matcher.go
- matchers_be_between.go
- matchers_be_empty.go
- matchers_be_greater_than.go
- matchers_be_less_than.go
- matchers_be_nil.go
- matchers_equal_to.go
- matchers_fail.go
- matchers_not.go
- matchers_say.go
- matchers_succeed.go
- os_interrupt_handling.go
- t.go
- util.go
- value_extractor_base.go
- value_extractor_numeric.go
Click to show internal directories.
Click to hide internal directories.