Skip to content

Commit

Permalink
Fix flaky test with false positives
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyhb committed Jan 31, 2024
1 parent e2fdf97 commit 5b1160f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions expr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,14 @@ func TestAggregateMatch(t *testing.T) {
require.NoError(t, err)
// False positives increase matches.
// require.EqualValues(t, 1, len(matched))
require.EqualValues(t,
`event.data.a == "yes"`,
matched[0].Parsed.Evaluable.GetExpression(),
)
found := false
for _, item := range matched {
if item.Parsed.Evaluable.GetExpression() == `event.data.a == "yes"` {
found = true
break
}
}
require.True(t, found)
})

// When passing input.data.b, we should match only one expression.
Expand Down

0 comments on commit 5b1160f

Please sign in to comment.