Deprecate mock.AnythingOfTypeArgument which should never have been
publicly exposed.
AnythingOfTypeArgument is now a type alias to the private
anythingOfTypeArgument and is marked as Deprecated in godoc.
The AnythingOfType constructor is still available.
The aim is to completely remove that alias.
Reverse order of return values of internal function getLen() to be more
consistent with stdlib (ex: os.LookupEnv).
Old: func (any) (ok bool, length int)
New: func (any) (length int, ok bool)
The `go` directive in go.mod is meant to indicate the minimum supported
version.
See: https://go.dev/doc/modules/gomod-ref#go
Signed-off-by: SuperQ <superq@gmail.com>
* EqualExportedValues: Handle pointer and slice fields
* Update assert/assertions.go
Co-authored-by: Michael Pu <michael.pu123@gmail.com>
* Reduce redundant calls to 'copyExportedFields'
* Update comments
* Add support for maps
* Update Go version support to 1.19 and onward
* Re-generate after rebasing
---------
Co-authored-by: Michael Pu <michael.pu123@gmail.com>
* add EventuallyWithT assertion
* Change "EventuallyWithT" condition acceptance to no-errors raised
This change updates the "EventuallyWithT" assertion variants (regular, formatted,
requirement) to consider a condition as "met" if no assertion errors were raised
in a tick.
This allows to write easier conditions which simply contain assertions, without
needing to return a bool. The equivalent of a condition returning true in the
previous implementation would be a a condition with a single "assert.True(..)" call.
* Declare the "Collect.Copy(T)" method as a testing helper
* run go generate
---------
Co-authored-by: Arik Kfir <arik@kfirs.com>
* assert: rename and refactor TestContainsFailMessage
I've renamed it to TestContainsNotContains and added a test case
structure so that I can use this test to validate the failure messages
from both Contains and NotContains,
There are no functional changes here, strictly refactoring. A new test
case will be added in a subsequent change.
* assert: fix error message formatting for NotContains
It was using "%s" to format the s and contains arguments, but these
could be any type that supports iteration such as a map. In this case
of NotContains failing against a map, it would print something like:
"map[one:%!s(int=1)]" should not contain "one"
Fix this using "%#v" as was already done for Contains and added test
cases covering both the "len()" / iterable failure messages as well as
the Contains/NotContains failure case.
The new message for this example map would be something like:
map[string]int{"one":1} should not contain "one"
As I am supposed to be a maintainer but have almost zero access to actually manage the project, I've found it difficult to help out. Since then my time has become fragmented and as such I'm removing myself as maintainer.
* Implement checking only exported fields
Co-authored-by: Anthony Chang <anthony-chang@users.noreply.github.com>
* Update comment
* Run go generate
* Make compatiable with Go 1.16.5
* Fix go generate files
* Fix white space changes
* Fix whitespace changes
* Fix whitespace changes in gogenerate files
---------
Co-authored-by: Anthony Chang <anthony-chang@users.noreply.github.com>