From 2bc6be281a56e846895c02ae8921aabf1797199d Mon Sep 17 00:00:00 2001 From: Matthias Loibl Date: Sat, 4 Nov 2017 18:17:30 +0100 Subject: [PATCH] Remove obsolete test for ByStatus slice --- silences_test.go | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/silences_test.go b/silences_test.go index 240426f..2d20ff9 100644 --- a/silences_test.go +++ b/silences_test.go @@ -1,7 +1,6 @@ package main import ( - "sort" "testing" "time" @@ -9,34 +8,6 @@ import ( "github.com/stretchr/testify/assert" ) -func TestByStatus(t *testing.T) { - s1 := types.Silence{EndsAt: time.Now().Add(-2 * time.Minute)} - s2 := types.Silence{EndsAt: time.Now().Add(-1 * time.Minute)} - s3 := types.Silence{EndsAt: time.Now().Add(1 * time.Minute)} - s4 := types.Silence{EndsAt: time.Now().Add(2 * time.Minute)} - - bs := ByStatus{s1} - sort.Sort(bs) - assert.Equal(t, s1, bs[0]) - - bs = ByStatus{s4, s1} - sort.Sort(bs) - assert.Equal(t, s4, bs[0]) - assert.Equal(t, s1, bs[1]) - - bs = ByStatus{s3, s2} - sort.Sort(bs) - assert.Equal(t, s3, bs[0]) - assert.Equal(t, s2, bs[1]) - - bs = ByStatus{s4, s2, s3, s1} - sort.Sort(bs) - assert.Equal(t, s4, bs[0]) - assert.Equal(t, s3, bs[1]) - assert.Equal(t, s2, bs[2]) - assert.Equal(t, s1, bs[3]) -} - func TestResolved(t *testing.T) { s := types.Silence{} assert.False(t, Resolved(s))