mirror of
https://github.com/stretchr/testify.git
synced 2025-05-31 11:42:44 +00:00
collect errors from condition in defer
This commit is contained in:
parent
4ed68e1bca
commit
89920137cd
@ -1930,9 +1930,11 @@ func EventuallyWithT(t TestingT, condition func(collect *CollectT), waitFor time
|
|||||||
tick = nil
|
tick = nil
|
||||||
go func() {
|
go func() {
|
||||||
collect := new(CollectT)
|
collect := new(CollectT)
|
||||||
condition(collect)
|
defer func() {
|
||||||
ch <- collect.errors
|
ch <- collect.errors
|
||||||
}()
|
}()
|
||||||
|
condition(collect)
|
||||||
|
}()
|
||||||
case errs := <-ch:
|
case errs := <-ch:
|
||||||
if len(errs) == 0 {
|
if len(errs) == 0 {
|
||||||
return true
|
return true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user