Releases: JosiahWitt/ensure
v0.4.0 Beta 1
Since v0.4.0
is going to be a larger release, we're starting with a short series of beta releases.
Changes
ensure.RunTableByIndex
:- The underlying implementation was refactored from the ground up to make it much more extensible and testable in the future
- Mocks can be completely ignored using the
`ensure:"-"`
tag, in addition to the existing`ensure:"ignoreunused"`
tag for making them optional ⚠️ Breaking Change: Unused mocks are now an error unless they are ignored (`ensure:"-"`
) or optional (`ensure:"ignoreunused"`
)- Warnings are no longer issued, since unused mocks are now an error
- Supports embedded pointer fields in structs and mocks instead of only embedded non-pointer fields
- Correctly handles "shadowed" fields in embedded fields in both
Subject
andMocks
- Duplicate mocks are now supported, but will cause errors when matching a Subject, unless one of them is ignored (
`ensure:"-"`
) or optional (`ensure:"ignoreunused"`
)
Support Go 1.20
Merge pull request #67 from JosiahWitt/go1.20 Support Go 1.20
CLI: Support Go 1.20
Merge pull request #67 from JosiahWitt/go1.20 Support Go 1.20
Internal minor refactors
This release should have no external changes. It is purely an internal refactor preparing for a future release.
Enhance IsNil, IsError, and MatchesAllErrors
Now nil
is handled correctly for slices, maps, channels, and functions in IsNil
, IsError
, and MatchesAllErrors
.
CLI: Small bugfix
No longer passes in the empty string to os.DirFS
in the CLI.
Print UTF-8 Byte Slices as Strings
Now if Equals
is provided actual and expected UTF-8 []byte
s, it prints them as strings. This is useful for things like the output from json.Marshal
, which is always a UTF-8 byte slice.
CLI: Go 1.19 Support
Go 1.19 changed two spaces to a tab to indicate a code block in a doc comment. This release updates the CLI to generate doc comments in that format.
CLI: Upgrade dependencies
Merge pull request #55 from JosiahWitt/upgrade-cli-deps Upgrade CLI dependencies to fix issue loading packages
CLI: Support generating mocks for generic interfaces
ensure mocks generate
now supports generic interfaces!