You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered a weird behavior when using HaveExactElements matcher. See this example:
actual:= [][]bool{
{true},
{false},
}
g.Expect(actual).To(ContainElement( // this fails, even though it should passHaveExactElements(Equal(false)),
))
I expect this assertion to pass, because actual contains an element []bool{false} which matches HaveExactElements(Equal(false)). But the assertion fails instead.
I believe the culprit is that HaveExactElementsMatcher leaves some internal state once its Match() returns false, which never gets cleaned and causes subsequent calls to always return false. Fwiw, cleaning the state at the beginning of the Match() fixed the issue for me.
Hi,
I've encountered a weird behavior when using HaveExactElements matcher. See this example:
I expect this assertion to pass, because
actual
contains an element[]bool{false}
which matchesHaveExactElements(Equal(false))
. But the assertion fails instead.I believe the culprit is that HaveExactElementsMatcher leaves some internal state once its Match() returns false, which never gets cleaned and causes subsequent calls to always return false. Fwiw, cleaning the state at the beginning of the Match() fixed the issue for me.
Version: 1.27.2
The text was updated successfully, but these errors were encountered: