All notable changes to this library are documented in this file.
The format is based on Keep a Changelog, and this library adheres to Semantic Versioning.
1.3.0 - 2025-02-17
- Deprecate the whole library. Avoid using assertion libraries. Use the standard library and github.com/google/go-cmp/cmp instead. Follow the official Go Test Comments.
1.2.0 - 2024-09-10
- Add
FailureMessage.Errmethod together withAssertionErrortype to represent assertion results aserrortype.
1.1.0 - 2024-02-06
This release adds length assertions.
- Add
Lenassertion forstring,[]T,map[K]Vtypes.
1.0.0 - 2023-04-05
This release contains breaking changes.
The repository is moved to github.com/fluentassert/verify
and the f package is renamed to verify.
The main additions are the new assertions for
bool, constraints.Ordered, constraints.Float, constraints.Integer,
string, error, []T, map[K]V, func() types.
- Add
True,False, assertion functions. - Add
Nil,NotNil, assertion functions. - Add
NoError,IsErrorassertion functions. - Add
Panics,NoPanicassertion functions. - Add
Eventually,EventuallyChanassertion functions. - Add
Orderedfunction which provides following assertions, in addition toComparable, viaFluentOrderedtype:LesserLesserOrEqualGreaterOrEqualGreater
- Add
Stringfunction which provides following assertions, in addition toOrdered, viaFluentStringtype:EmptyNotEmptyContainNotContainPrefixNoPrefixSufixNoSufixEqualFoldNotEqualFoldMatchRegexNotMatchRegex
- Add
Numberfunction which provides following assertions, in addition toOrdered, viaFluentNumbertype:InDeltaNotInDeltaInEpsilonNotInEpsilon
- Add
Errorfunction which provides following assertions, in addition toAnyandString(for error message), viaFluentObjandFluentStringtypes:IsIsNotAsNotAs
- Add
Slicefunction which provides following assertions, in addition toAny, viaFluentSlicetype:EmptyNotEmptyEquivalentNotEquivalentContainNotContainAnyAllNone
- Add
Mapfunction which provides following assertions, in addition toAny, viaFlientMaptype:EmptyNotEmptyContainNotContainContainPairNotContainPairAnyAllNone
- Add
FailureMessage.Prefixmethod together withAndandOrfunctions to facilitate creating complex assertions.
- The
fpackage is renamed toverify. - Rename
ObjandFluentObjtoAnyandFluentAny. - Rename
ComparableandFluentComparabletoObjandFluentObj. - Change the
Checkassertion foranyobject so that the provided function has to returnFailureMessageinstead of astring. ZeroandNonZeromethods are moved toFluentComparable.- Better failure messages.
0.2.0 - 2022-10-01
This release is a complete rewrite. It is not compatible with the previous release.
The new API is type-safe and easier to extend.
The release provides assertions for any, comparable.
The next release is supposed to provide assertions for
constraints.Ordered, string, error, []T, map[K]V, func().
- Add
FailureMessagewhich encapsulates the failure message and methods for error reporting. - Add
Objfunction which provides following assertions viaFluentObjecttype:CheckShouldShouldNotDeepEqualNotDeepEqualZeroNonZero
- Add
Comparablefunction which provides following assertions, in addition toObj, viaFluentComparabletype:EqualNotEqual
- Require Go 1.18.
- Fix error reporting line (use
t.Helper()when available).
- Remove all previous functions and types (API rewrite).
0.1.0 - 2021-05-11
First release after the experiential phase.
- Add
f.Assertthat can be used instead oft.Errormethods. - Add
f.Requirethat can be used instead oft.Fatalmethods. - Add
Shouldassertion that can be used with custom predicates. - Add
Eqassertion that checks ifgotis deeply equal towant. - Add
Nilassertion that checks ifgotisnil. - Add
Errassertion that checks ifgotis anerror. - Add
Panicassertion that checks if callinggotresults in a panic. - Add
NoPanicassertion that checks if callinggotreturns without panicking.