Skip to content

Commit

Permalink
pathologicalevents: fix checks order in TestAllowedRepeatedEvents
Browse files Browse the repository at this point in the history
check for nil first.
  • Loading branch information
machine424 committed Jan 21, 2024
1 parent 92d04bb commit f0af33c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ func TestAllowedRepeatedEvents(t *testing.T) {
}

if test.expectedAllowName != "" {
assert.True(t, allowed, "duplicated event should have been allowed, but we matched: %s", matchedAllowedDupe.Name())
require.NotNil(t, matchedAllowedDupe, "an allowed dupe even should have been returned")
assert.True(t, allowed, "duplicated event should have been allowed, but we matched: %s", matchedAllowedDupe.Name())
assert.Equal(t, test.expectedAllowName, matchedAllowedDupe.Name(), "duplicated event was not allowed by the correct SimplePathologicalEventMatcher")
} else {
require.False(t, allowed, "duplicated event should not have been allowed")
Expand Down

0 comments on commit f0af33c

Please sign in to comment.