Skip to content

Commit

Permalink
replace require.Len with require.Empty where needed
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Hunter <[email protected]>
  • Loading branch information
Spaceman1701 committed Aug 21, 2024
1 parent 45eca6c commit 0901171
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions silence/silence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ func TestSilenceGCOverTime(t *testing.T) {
n, err := s.GC()
require.NoError(t, err)
require.Equal(t, 1, n)
require.Len(t, s.st, 0)
require.Len(t, s.mc, 0)
require.Empty(t, s.st)
require.Empty(t, s.mc)
})

t.Run("replacing a silences does not leak cache entries", func(t *testing.T) {
Expand Down Expand Up @@ -170,8 +170,8 @@ func TestSilenceGCOverTime(t *testing.T) {
n, err := s.GC()
require.NoError(t, err)
require.Equal(t, 2, n)
require.Len(t, s.st, 0)
require.Len(t, s.mc, 0)
require.Empty(t, s.st)
require.Empty(t, s.mc)
})

// This test checks for a memory leak that occurred in the matcher cache when
Expand Down Expand Up @@ -210,8 +210,8 @@ func TestSilenceGCOverTime(t *testing.T) {
n, err := s.GC()
require.NoError(t, err)
require.Equal(t, 1, n)
require.Len(t, s.st, 0)
require.Len(t, s.mc, 0)
require.Empty(t, s.st)
require.Empty(t, s.mc)
})
}

Expand Down

0 comments on commit 0901171

Please sign in to comment.