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.2.0 - 2024-09-10
- Add
FailureMessage.Err
method together withAssertionError
type to represent assertion results aserror
type.
1.1.0 - 2024-02-06
This release adds length assertions.
- Add
Len
assertion forstring
,[]T
,map[K]V
types.
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
,IsError
assertion functions. - Add
Panics
,NoPanic
assertion functions. - Add
Eventually
,EventuallyChan
assertion functions. - Add
Ordered
function which provides following assertions, in addition toComparable
, viaFluentOrdered
type:Lesser
LesserOrEqual
GreaterOrEqual
Greater
- Add
String
function which provides following assertions, in addition toOrdered
, viaFluentString
type:Empty
NotEmpty
Contain
NotContain
Prefix
NoPrefix
Sufix
NoSufix
EqualFold
NotEqualFold
MatchRegex
NotMatchRegex
- Add
Number
function which provides following assertions, in addition toOrdered
, viaFluentNumber
type:InDelta
NotInDelta
InEpsilon
NotInEpsilon
- Add
Error
function which provides following assertions, in addition toAny
andString
(for error message), viaFluentObj
andFluentString
types:Is
IsNot
As
NotAs
- Add
Slice
function which provides following assertions, in addition toAny
, viaFluentSlice
type:Empty
NotEmpty
Equivalent
NotEquivalent
Contain
NotContain
Any
All
None
- Add
Map
function which provides following assertions, in addition toAny
, viaFlientMap
type:Empty
NotEmpty
Contain
NotContain
ContainPair
NotContainPair
Any
All
None
- Add
FailureMessage.Prefix
method together withAnd
andOr
functions to facilitate creating complex assertions.
- The
f
package is renamed toverify
. - Rename
Obj
andFluentObj
toAny
andFluentAny
. - Rename
Comparable
andFluentComparable
toObj
andFluentObj
. - Change the
Check
assertion forany
object so that the provided function has to returnFailureMessage
instead of astring
. Zero
andNonZero
methods 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
FailureMessage
which encapsulates the failure message and methods for error reporting. - Add
Obj
function which provides following assertions viaFluentObject
type:Check
Should
ShouldNot
DeepEqual
NotDeepEqual
Zero
NonZero
- Add
Comparable
function which provides following assertions, in addition toObj
, viaFluentComparable
type:Equal
NotEqual
- 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.Assert
that can be used instead oft.Error
methods. - Add
f.Require
that can be used instead oft.Fatal
methods. - Add
Should
assertion that can be used with custom predicates. - Add
Eq
assertion that checks ifgot
is deeply equal towant
. - Add
Nil
assertion that checks ifgot
isnil
. - Add
Err
assertion that checks ifgot
is anerror
. - Add
Panic
assertion that checks if callinggot
results in a panic. - Add
NoPanic
assertion that checks if callinggot
returns without panicking.