forked from TrueCloudLab/distribution
notifications: use consistent names for test tables
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
f4be328bff
commit
e9ac1728e6
1 changed files with 10 additions and 10 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue