- 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
MinWidth
formatting 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.T
usage seamlessly equivalent totesting.T
-- testing functions prototype argument renamed tot
instead ofb
.
- Add
bdd
sub-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.Set
andvalue.ReflectSet()
- Move sequence / sub-sequence operations to
value.IndexOfSubsequence()
- Use code generation and go:generate to collect all predicate functions defined
in
predicate/impl
and 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.Time
support 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
predicate
to predicate package andasserter
to 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
Asserter
type definitions - Cleanup
predicate
type 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