From 57f9f31af92f556c3a5b7e4e435c3a06a8fa077c Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 30 Apr 2023 14:41:57 +0200 Subject: [PATCH] notifications: don't use un-keyed structs Signed-off-by: Sebastiaan van Stijn --- notifications/sinks_test.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/notifications/sinks_test.go b/notifications/sinks_test.go index 5347bb03..de3eae3f 100644 --- a/notifications/sinks_test.go +++ b/notifications/sinks_test.go @@ -74,11 +74,11 @@ func TestIgnoredSink(t *testing.T) { } tests := []testcase{ - {nil, nil, blob}, - {[]string{"other"}, []string{"other"}, blob}, - {[]string{"blob", "manifest"}, []string{"other"}, nil}, - {[]string{"other"}, []string{"pull"}, blob}, - {[]string{"other"}, []string{"pull", "push"}, nil}, + {expected: blob}, + {ignoreMediaTypes: []string{"other"}, ignoreActions: []string{"other"}, expected: blob}, + {ignoreMediaTypes: []string{"blob", "manifest"}, ignoreActions: []string{"other"}}, + {ignoreMediaTypes: []string{"other"}, ignoreActions: []string{"pull"}, expected: blob}, + {ignoreMediaTypes: []string{"other"}, ignoreActions: []string{"pull", "push"}}, } for _, tc := range tests { @@ -97,12 +97,12 @@ func TestIgnoredSink(t *testing.T) { } tests = []testcase{ - {nil, nil, manifest}, - {[]string{"other"}, []string{"other"}, manifest}, - {[]string{"blob"}, []string{"other"}, manifest}, - {[]string{"blob", "manifest"}, []string{"other"}, nil}, - {[]string{"other"}, []string{"push"}, manifest}, - {[]string{"other"}, []string{"pull", "push"}, nil}, + {expected: manifest}, + {ignoreMediaTypes: []string{"other"}, ignoreActions: []string{"other"}, expected: manifest}, + {ignoreMediaTypes: []string{"blob"}, ignoreActions: []string{"other"}, expected: manifest}, + {ignoreMediaTypes: []string{"blob", "manifest"}, ignoreActions: []string{"other"}}, + {ignoreMediaTypes: []string{"other"}, ignoreActions: []string{"push"}, expected: manifest}, + {ignoreMediaTypes: []string{"other"}, ignoreActions: []string{"pull", "push"}}, } for _, tc := range tests {