From e9ac1728e6ebd6ba90bf3b31bdff7422d178f4de Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 30 Apr 2023 14:40:44 +0200 Subject: [PATCH] notifications: use consistent names for test tables Signed-off-by: Sebastiaan van Stijn --- notifications/sinks_test.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/notifications/sinks_test.go b/notifications/sinks_test.go index b1e51d5b0..5347bb035 100644 --- a/notifications/sinks_test.go +++ b/notifications/sinks_test.go @@ -73,7 +73,7 @@ func TestIgnoredSink(t *testing.T) { expected events.Event } - cases := []testcase{ + tests := []testcase{ {nil, nil, blob}, {[]string{"other"}, []string{"other"}, blob}, {[]string{"blob", "manifest"}, []string{"other"}, nil}, @@ -81,22 +81,22 @@ func TestIgnoredSink(t *testing.T) { {[]string{"other"}, []string{"pull", "push"}, nil}, } - for _, c := range cases { + for _, tc := range tests { ts := &testSink{} - s := newIgnoredSink(ts, c.ignoreMediaTypes, c.ignoreActions) + s := newIgnoredSink(ts, tc.ignoreMediaTypes, tc.ignoreActions) if err := s.Write(blob); err != nil { t.Fatalf("error writing event: %v", err) } ts.mu.Lock() - if !reflect.DeepEqual(ts.event, c.expected) { - t.Fatalf("unexpected event: %#v != %#v", ts.event, c.expected) + if !reflect.DeepEqual(ts.event, tc.expected) { + t.Fatalf("unexpected event: %#v != %#v", ts.event, tc.expected) } ts.mu.Unlock() } - cases = []testcase{ + tests = []testcase{ {nil, nil, manifest}, {[]string{"other"}, []string{"other"}, manifest}, {[]string{"blob"}, []string{"other"}, manifest}, @@ -105,17 +105,17 @@ func TestIgnoredSink(t *testing.T) { {[]string{"other"}, []string{"pull", "push"}, nil}, } - for _, c := range cases { + for _, tc := range tests { ts := &testSink{} - s := newIgnoredSink(ts, c.ignoreMediaTypes, c.ignoreActions) + s := newIgnoredSink(ts, tc.ignoreMediaTypes, tc.ignoreActions) if err := s.Write(manifest); err != nil { t.Fatalf("error writing event: %v", err) } ts.mu.Lock() - if !reflect.DeepEqual(ts.event, c.expected) { - t.Fatalf("unexpected event: %#v != %#v", ts.event, c.expected) + if !reflect.DeepEqual(ts.event, tc.expected) { + t.Fatalf("unexpected event: %#v != %#v", ts.event, tc.expected) } ts.mu.Unlock() }