Releases: ansel1/vespucci
Release 4.1.9
Release 4.1.8
Performance Improvements:
- Contains/ContainsMatch are now significantly faster and do fewer allocations
Release 4.1.7
Fix some bugs in AssertContains/Equiv. Should always fail if there is an error normalizing.
Release 4.1.6
Merged PreserveTime and ParseTime into one option, NormalizeTime. After using, it was clear it didn't make sense to use these options separately. Either all values should be coerced to times, if possible, or the values should be coerced to strings.
Also, fixed an issue when parsing times: if a struct was normalized by using json.Marshal, nested time.Time values would be marshaled to strings. Even if NormalizeTime was true, these values weren't converted back to native time.Time values. That's fixed now.
Release 4.1.5
- Performance improvements in Contains and Equivalent
- ContainsMatch and EquivalentMatch now return a single Error, rather than separate errors for each value. The first time an error occurs, the match immediately returns, indicating a false match, and storing the error in the Match object.
- Match V1, and V2 values now only return the value at the point where the match failed or where the error occurred, rather than the entire normalized version of the original v1 and v2 arguments. This is because Contains no longer does a full, deep normalization of the value.
- Normalize options now have functional counterparts, which can be passed to Normalize(), Transform(), Merge(), and Get().
- Two new Normalize options, PreserveTimes and ParseTimes allow special handling of time values. PreserveTimes preserves time.Time values instead of converting them to strings. It will also normalize *time.Time to time.Time. ParseTimes will try to parse strings as time objects and convert them to time.Time values if possible.
Release 4.1.4
- Contains and some other functions would modify the input values in place to save a little on memory allocations. But this is surprising behavior in many cases, and wasn't always even controllable by the caller. All functions now make copies of the input values and normalize the copies, leaving the input value untouched. This is safer in most cases. Callers can normalize the value first before calling the other functions, to avoid the allocations, if necessary.
Release 4.1.3
Small optimization in Empty for time.Time values.
Release 4.1.2
- fixed some bugs with StringContains() and IgnoreTimeZones()
- Switched build over to Github Actions
Release 4.1.1
Fixes some bugs in the contains/equivalent error messages and assertion messages.
Release v4.1.0
- learned ContainsMatch, which is like Contains, but returns more information about the match
- learned Equivalent and EquivalentMatch, which is like an approximate deep equals, using the same matching logic as Contains
- better messages from Contains explaining where the mismatch is
- new package: mapstest. Implements test assertions for containment and equivalency. Prints pretty diffs when values don't match
- support for proto.Message: if value is a proto.Message, use protojson.Marshal instead of json.Marshal