Bracken
a31a53e5b4
Merge pull request #1615 from DevotedHealth/mauclair-mock-match-sprintf
...
Lazily render mock diff output on successful match
2025-05-06 11:20:15 +01:00
Mike Auclair
e6575e05ed
Update mock.go
2025-03-24 14:24:41 -04:00
Bracken
c3915e850a
Merge branch 'master' into refactor/simplify-with-sprintf-q
2025-03-23 14:22:18 +01:00
Bracken
1e7fb5865a
Merge pull request #1709 from techfg/chore/issue-1621-update-docs
...
chore: update docs for Unset #1621
2025-03-22 12:44:25 +01:00
techfg
c6ac9bb91d
chore: update per PR feedback
2025-03-21 06:25:01 -07:00
Grégoire Paris
b1c9368f81
Improve existing docs
2025-03-21 13:21:25 +01:00
Grégoire Paris
89086b0757
Document consequences of calling t.FailNow()
...
These comments are adapted from t.FailNow()'s own documentation.
Closes #1701
2025-03-19 20:50:44 +01:00
techfg
098128fd10
chore: update docs for Unset #1621
2025-03-18 12:48:09 -07:00
Mike Auclair
cbf6e73c7e
simplified renderers
2024-12-17 18:30:48 +00:00
Mike Auclair
3d98e693c7
cleanup
2024-12-17 18:25:59 +00:00
Oleksandr Redko
30f3cef5ad
Apply suggestions from code review
...
Co-authored-by: Olivier Mengué <dolmen@cpan.org>
2024-12-10 14:08:46 +02:00
Oleksandr Redko
d57bac8721
refactor: use %q to simplify fmt.Sprintf
2024-11-24 18:28:03 +02:00
Arjun Dhawan
7d99b2b43d
attempt 2
2024-10-27 08:07:57 +01:00
Arjun Dhawan
05f87c0160
more similar
2024-10-27 08:05:00 +01:00
Arjun Dhawan
ea7129e006
better fmt
2024-10-27 08:02:53 +01:00
Arjun Dhawan
be992afabf
trial
2024-10-24 13:28:30 +02:00
Arjun Dhawan
fb67df6392
no regression
2024-10-24 11:40:45 +02:00
Arjun Dhawan
822223ec34
fix name regression
2024-10-24 11:30:00 +02:00
Arjun Dhawan
22d3bd5def
in order to remain compatible with go1..19, don't compare function names (but do include them in the diff output)
2024-10-24 11:30:00 +02:00
Arjun Dhawan
9c174eb41c
fix: compare functional option names for indirect calls
...
Closes Functional Options testing broken for indirect calls #1380
2024-10-24 11:30:00 +02:00
Bracken
a012e45d18
Merge pull request #1636 from rainhq/jayd3e.fix_return_arguments
...
Record Return Arguments of a Call
2024-10-16 14:07:58 +01:00
Oleksandr Redko
ba3e7c34d5
mock: fix doc comment for NotBefore
2024-10-04 18:06:40 +03:00
Bracken
85a526818c
Merge branch 'master' into master
2024-10-02 17:21:55 +01:00
Spirin
f3f7181b01
Merge branch 'master' into unexpected-method-caller-info
2024-10-01 02:22:07 +03:00
Bracken
72e3b61028
Merge branch 'master' into mock-simplify-FunctionalOptions-impl
2024-09-30 23:28:38 +01:00
spirin
ea6964c2e9
mock: caller information for unexpected method call
2024-09-30 21:33:46 +03:00
Reynier Ortiz
f17409f81f
mock: in order mock calls
...
(requested changes applied)
2024-09-25 12:03:55 -04:00
Reynier Ortiz
7268a5bc0b
mock: in order mock calls
2024-09-06 09:18:07 -04:00
Joseph Dallago
da63673a11
Now properly record the ReturnArguments as part of the call.
2024-08-29 22:05:04 +03:00
Mike Auclair
2b53603313
wip
2024-06-25 14:59:20 +00:00
Mike Auclair
dd725333f3
wip
2024-06-24 20:29:26 +00:00
Bracken
8d4dcbbccb
Merge pull request #1569 from stretchr/mock-more-AnythingOfTypeArgument-alternatives
...
mock: document more alternatives to deprecated AnythingOfTypeArgument
2024-04-23 16:15:28 +00:00
Olivier Mengué
8c324a0bbd
mock: simpler deprecation doc for AnythingOfTypeArgument
...
Co-authored-by: Bracken <abdawson@gmail.com>
2024-04-23 15:23:21 +02:00
Olivier Mengué
d4a63f5b89
mock: simplify implementation of FunctionalOptions
...
Remove unnecessary use of reflect in the implementation of
mock.FunctionalOptions().
2024-04-22 23:10:37 +02:00
Snir Yehuda
da1e1476cb
Merge branch 'master' into master
2024-03-18 09:47:57 +02:00
Olivier Mengué
3c302f75ae
mock: improve doc ( #1570 )
...
## Summary
Improve API doc of package
[`mock`](https://pkg.go.dev/github.com/stretchr/testify/mock ):
- add godoc links
- indent example code
## Motivation
Readability.
2024-03-10 11:42:04 +01:00
Olivier Mengué
aca1890ec1
mock: document more alternatives to deprecated AnythingOfTypeArgument
2024-03-07 11:59:12 +01:00
Snir Yehuda
f1b5324b90
assert.FunctionalOptions: fix go doc
2024-03-06 11:28:50 +03:00
Tom Wright
cab2acc70f
Do not get argument again unnecessarily in Arguments.Error()
2024-03-06 03:03:10 +01:00
Bracken
c719de3088
Merge pull request #1331 from ianrose14/ianrose/assertexpectations-skipped
...
Ensure AssertExpectations does not fail in skipped tests
2024-02-17 17:50:13 +00:00
Ian Rose
1837f62a5f
Ensure AssertExpectations does not fail in skipped tests
2023-10-31 00:00:55 +01:00
Olivier Mengué
307c9344b8
mock: refactor IsType
...
Reduce calls to reflect.Type in implementation of mock.IsType by
extracting the type early.
This also avoids to keep alive references to the argument value.
2023-10-16 13:57:23 +02:00
Olivier Mengué
413628c0f4
mock: simplify Arguments.Diff
...
Use a type switch instead of reflect.TypeOf comparisons.
2023-10-16 13:57:23 +02:00
Olivier Mengué
f24f3ba986
mock: deprecate AnythingOfTypeArgument ( #1434 )
...
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.
2023-08-08 11:05:09 +02:00
Anant Vyas
a23f5db224
mock: move regexp compilation outside of Called ( #631 )
...
Co-authored-by: Olivier Mengué <dolmen@cpan.org>
2023-08-01 10:07:29 +02:00
Olivier Mengué
862e41010c
Merge pull request #1360 from hikyaru-suzuki/feature/update_logging_output
...
mock: AssertExpectations log reason only on failure
2023-07-29 05:52:15 +02:00
Ed
9f0f17fe64
Correct spelling/grammar
2023-05-26 10:38:59 +01:00
Harald Nordgren
4c93d8f201
EqualExportedValues: Handle nested pointer, slice and map fields ( #1379 )
...
* 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>
2023-05-11 07:42:04 +10:00
Nisheeth Barthwal
b3106d772c
allow testing for functional options ( #1023 )
...
* allow testing for functional options
* add linting docs
* use reflect magic to obtain FunctionalOption name
Co-authored-by: dillonstreator <dillonstreator@gmail.com>
---------
Co-authored-by: dillonstreator <dillonstreator@gmail.com>
2023-05-10 06:55:48 +10:00
鈴木 光
75b9b6dfff
update: log reason output only if failed
2023-03-09 18:49:15 +09:00