📖 2 min read (~ 400 words).

Quick API index

Domains

All assertions are classified into 19 domains to help navigate the API, depending on your use case.

API metrics

Counts for core functionality, and generated variants (formatted, forward, forward-formatted).

KindCountNote
All core functions135Maintained core
All core assertions131Usage with *testing.T
Generic assertions50Type-safe assertions (“T” suffix)
Helpers (not assertions)4General-purpose utilities, not assertions
Others0
assert/require variants424Generated variants
Total assertions variants848Available assertions API
Total API surface858

Quick index

Table of core assertions, excluding variants. Each function is side by side with its logical opposite (when available).

AssertionOppositeDomainKind
CallerInfocommonhelper
Conditioncondition
Consistently[C Conditioner] condition
ContainsNotContainscollection
DirExistsDirNotExistsfile
ElementsMatchNotElementsMatchcollection
ElementsMatchT[E comparable] NotElementsMatchTcollection
EmptyNotEmptyequality
EqualNotEqualequality
EqualErrorerror
EqualExportedValuesequality
EqualT[V comparable] NotEqualTequality
EqualValuesNotEqualValuesequality
ErrorNoErrorerror
ErrorAsNotErrorAserror
ErrorContainserror
ErrorIsNotErrorIserror
EventuallyWith[C CollectibleConditioner] condition
Eventually[C Conditioner] Nevercondition
Exactlyequality
Failtesting
FailNowtesting
FileEmptyFileNotEmptyfile
FileExistsFileNotExistsfile
GreaterLessOrEqualcomparison
GreaterOrEqualLesscomparison
GreaterOrEqualT[Orderable Ordered] LessTcomparison
GreaterT[Orderable Ordered] LessOrEqualTcomparison
HTTPBodyhttphelper
HTTPBodyContainsHTTPBodyNotContainshttp
HTTPErrorhttp
HTTPRedirecthttp
HTTPStatusCodehttp
HTTPSuccesshttp
ImplementsNotImplementstype
InDeltanumber
InDeltaMapValuesnumber
InDeltaSlicenumber
InDeltaT[Number Measurable] number
InEpsilonnumber
InEpsilonSlicenumber
InEpsilonT[Number Measurable] number
IsDecreasingIsNonDecreasingordering
IsDecreasingT[OrderedSlice ~[]E, E Ordered] IsNonDecreasingTordering
IsIncreasingIsNonIncreasingordering
IsIncreasingT[OrderedSlice ~[]E, E Ordered] IsNonIncreasingTordering
IsOfTypeT[EType any] IsNotOfTypeTtype
IsTypeIsNotTypetype
JSONEqjson
JSONEqBytesjson
JSONEqT[EDoc, ADoc Text] json
JSONMarshalAsT[EDoc Text] json
JSONUnmarshalAsT[Object any, ADoc Text] json
KindNotKindtype
Lencollection
MapContainsT[Map ~map[K]V, K comparable, V any] MapNotContainsTcollection
MapEqualT[K, V comparable] MapNotEqualTcollection
NilNotNilequality
NoFileDescriptorLeaksafety
NoGoRoutineLeaksafety
ObjectsAreEqualcommonhelper
ObjectsAreEqualValuescommonhelper
PanicsNotPanicspanic
PanicsWithErrorpanic
PanicsWithValuepanic
PositiveNegativecomparison
PositiveT[SignedNumber SignedNumeric] NegativeTcomparison
RegexpNotRegexpstring
RegexpT[Rex RegExp, ADoc Text] NotRegexpTstring
SameNotSameequality
SameT[P any] NotSameTequality
SeqContainsT[E comparable] SeqNotContainsTcollection
SliceContainsT[Slice ~[]E, E comparable] SliceNotContainsTcollection
SliceEqualT[E comparable] SliceNotEqualTcollection
SliceSubsetT[Slice ~[]E, E comparable] SliceNotSubsetTcollection
SortedT[OrderedSlice ~[]E, E Ordered] NotSortedTordering
StringContainsT[ADoc, EDoc Text] StringNotContainsTcollection
SubsetNotSubsetcollection
TrueFalseboolean
TrueT[B Boolean] FalseTboolean
WithinDurationtime
WithinRangetime
YAMLEqyaml
YAMLEqBytesyaml
YAMLEqT[EDoc, ADoc Text] yaml
YAMLMarshalAsT[EDoc Text] yaml
YAMLUnmarshalAsT[Object any, ADoc Text] yaml
ZeroNotZerotype