Releases: maargenton/go-testpredicate
Releases · maargenton/go-testpredicate
v1.6.0
Improvements
- Update Go version requirement to 1.23 minimum (up from Go 1.19 in release v1.5.0, lowered from 1.24 in prior PR)
- Cleanup
Panics()predicate -- no morepanic(nil)special case - Add
IsA()predicate andbdd.TypeOf()for type assertion - Add
itertest.VerifySeqCanStopAfterN()anditertest.VerifySeq2CanStopAfterN()to verify proper implementation ofiter.Seqanditer.Seq2interfaces - Add
bdd.Used(),bdd.First(),bdd.Second()andbdd.Third()convenience functions
Code changes
v1.5.0
Improvements
- Update value.Field implementation to support '.' in map keys and pointer receiver for method invocation.
- Add slogtest package for recording structured log output during tests.
Code changes
v1.4.0
Improvements
- Add flexibility to
IsError()to support:IsError("")matching any errorIsError(nil)matching no errorIsError(err)matching witherrors.Is(),IsError(<string>)matching errors whose message contains the stringIsError(<regexp>)matching errors whose message match the regular expression
- Relax
IsNotNil()to accept values of non-nillable types as not nil. - Add
t.With()as an option to further qualify the test conditions
Code changes
- Update CI, bump go min version to 1.19 (#23)
- Fix CI on Windows runners (#24)
- Add support for
t.With(...)in BDD-style test structure (#25) - Relax implementation of
.IsNotNil()to return true for any value of a non-nillable type (#26) - Make
.IsError(...)more flexible (#27)
Related issues
v1.3.0
Improvements
- Add
.AsError()as a transformation for testing against a specific error
types and accessing specific fields in the target type. - Add
message:output for errors, printing out the formatted error message.
v1.2.1
Bug fix
- Fix crash in output formatting code caused by string wrapping logic in deeply
nested cases where target width decreases to 0 or below.
Improvements
- Add
MinWidthformatting option to preserve reasonable formatting even with
deeply indented values, default to 40 for test output - Fix indentation in README code samples
v1.2.0
Major Changes
- Add support for recording un-evaluated predicates in table driven tests.
- Reorganize packages hierarchy, removing internal and keeping only API-level
packages at the top level under pkg. - Add
.Passes()to evaluate sub-expression predicate on single value.
Improvements
.IsError()prints out string version of the error for readability..IsError(nil)provides better description when testing for no error.
v1.1.1
Improvements
- Fix code completion hints to make
bdd.Tusage seamlessly equivalent to
testing.T-- testing functions prototype argument renamed totinstead of
b.
v1.1.0
Major Changes
- Add
bddsub-package to support BDD-style bifurcated execution of nested test
sections.
v1.0.1
v1.0.0
Major Changes
- Remove old deprecated API. Use
verify.That()/require.That(). - Reduce external dependencies to preserve go 1.14 compatibility