From f345aabee17669184c82c4e91453c6339cb2f548 Mon Sep 17 00:00:00 2001 From: Ethan Hunter Date: Wed, 21 Aug 2024 09:31:33 -0400 Subject: [PATCH] replace require.Len with require.Empty where needed Signed-off-by: Ethan Hunter --- silence/silence_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/silence/silence_test.go b/silence/silence_test.go index 6d0b56365c..b956093c23 100644 --- a/silence/silence_test.go +++ b/silence/silence_test.go @@ -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) { @@ -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 @@ -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) }) }