- 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
- Update bifurcated execution model description (#36)
- Add
bdd.First(),bdd.Second()andbdd.Third()helper functions (#35) - Add
IsA()predicate for type assertion (#34) - Add
itertestpackage to test expected iterator behavior (#33) - Update dependency to Go 1.24 (#32)
- 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.
- Update value.Field implementation (#30)
- Add slogtest package for recording structured log output during tests (#28)
- 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
- 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)
- BDD style given-when-then could benefit from a "with" clause (#22)
IsNotNil()predicate is too strict (#20).IsError(...)predicate could be more flexible (#21)
- 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.
- Fix crash in output formatting code caused by string wrapping logic in deeply nested cases where target width decreases to 0 or below.
- Add
MinWidthformatting option to preserve reasonable formatting even with deeply indented values, default to 40 for test output - Fix indentation in README code samples
- 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.
.IsError()prints out string version of the error for readability..IsError(nil)provides better description when testing for no error.
- Fix code completion hints to make
bdd.Tusage seamlessly equivalent totesting.T-- testing functions prototype argument renamed totinstead ofb.
- Add
bddsub-package to support BDD-style bifurcated execution of nested test sections.
- Remove old deprecated API. Use
verify.That()/require.That(). - Reduce external dependencies to preserve go 1.14 compatibility
- Add ability to record context key-value pairs with additional arguments to
verify.That()/require.That().require.That(t, re.MatchString(tc.match), require.Context{Name: "re", Value: re.String()}, require.Context{Name: "match", Value: tc.match}, ).IsTrue()
- Fix name of
.Field(...)predicate, and include keypath as name in context. - Improve formatting of
[]interface{}values.
- Remove special case for error formatting. Error values in test context used to
be handled as a special case and formatted with a simple
%v; they are now formatted just like any other value.
- Fix issue with
.Contains(...)failing to match sub-sequence at the very beginning of the value.
- Cleanup documentation
- Improve
rake info, intermediate version number generation
- Add
.All()and.Any()collection predicates withsubexpr.Value()sub-predicate to operate om individual elements. - Add
.Field(keypath)transformation predicate to extract values from structs and maps.
- Update readme badges and fix comment typos
- Add / cleanup documentation comments
- Add release history
- Add workflow to create release on version tags (using rakefile task to precess release notes)
Significant API change, removing asserter object and using verify.That(),
require.That() and call chaining to define assertions. v0.4.x API is still
available but should considered deprecated and will be removed by v1.0.0.
- Implement new API based on
verify.That()/require.That()and call chaining. - Switch to go 1.14 minimal requirement, needed for
testing.T.Cleanup() - In prettyprint package, remove unused IndentWidth
- Move set operations to
value.Setandvalue.ReflectSet() - Move sequence / sub-sequence operations to
value.IndexOfSubsequence() - Use code generation and go:generate to collect all predicate functions defined
in
predicate/impland expose them as methods onbuilder.Builder.
- Update documentation
- Remove Travis CI configuration
- Add github action to build and test packages, with coverage on codecov
Fix value formatting on assertion failure
Fix value.CompareUnordered() to not panic with nil interface
- Add missing call to
t.Helper()within nested asserter functions - Cleanup error messages referring to type issues with quoted type and no value
- Add
time.Timesupport invalue.CompareOrdered() - Change message format for
p.IsNoError()andp.IsError()
Documentation cleanup
Significant API change, now using asserter.New() to create asserter and
p.IsTrue() to refer to predicates.
- Move
predicateto predicate package andasserterto asserter package - Move all pre-defined predicates to package p
- Move
utils.ValueAs...()andutils.Compare...()to a new value package - Remove
utils.FormatValue()and replace remaining uses withprettyprint.FormatValue() - Asserter does not abort on failure by default, and details are interpreted as key-value pairs with formatted values.
- New format for values reporting with a go-like syntax
- Replace
utils.FormatValue()with new pretty-printer - Add pkg/prettyprint with new value formatter that display values in a go-like syntax, with multi-line formatting, line wrap for long strings, and ellipsis for less relevant details.
- Fix collection predicate to only look at PredicateResult to determine success
- Fix
IsNil()andIsNotNil()predicates (were only testing for literal nil, not nil pointers and such) - Add
IsTrue()andIsFalse()predicates for convenience
- Add predicates to test panic cases
- Add better support for 1.13
- Change
pred.IsError(...)to be included only with go1.13 or later, using new built-inerrors.Is(), and remove dependency on 'golang.org/x/xerrors' - Add go1.13 to CI build targets
- Change format value limit to 80 characters, with better adaptive formatting
- Add
utils.MaxAbsoluteDifference()to extract the largest absolute difference between equally shaped collections of values - Change
pred.CloseTo()to support component-wise comparison of collection types
- Cleanup
Assertertype definitions - Cleanup
predicatetype definitions - Update documentation with a summary of the built-in predicates
- Add support for
pred.IsError(nil)for consistency - Add missing documentation for
pred.IsError()
- Add
pred.Eq()andpred.Ne()alias predicates for IsEqualTo() and IsNotEqualTo() - Add
pred.IsNoError()andpred.IsError()with support for newxerrors.Is()error wrapping
- Add go 1.12 for Travis CI build
- Update references for renamed account
- Fix typos in documentation examples
- CI: Enable go 1.11 modules and remove go tip version -- too slow
Documentation improvements and CI setup
Initial public release
Overview