mirror of
https://github.com/distribution/distribution.git
synced 2025-09-20 18:50:00 +00:00
reference: TestMatch(): use sub-tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -608,6 +608,9 @@ func TestMatch(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, tc := range tests {
|
for _, tc := range tests {
|
||||||
|
tc := tc
|
||||||
|
t.Run(tc.reference, func(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
named, err := ParseAnyReference(tc.reference)
|
named, err := ParseAnyReference(tc.reference)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@@ -619,6 +622,7 @@ func TestMatch(t *testing.T) {
|
|||||||
if actual != tc.expected {
|
if actual != tc.expected {
|
||||||
t.Fatalf("expected %s match %s to be %v, was %v", tc.reference, tc.pattern, tc.expected, actual)
|
t.Fatalf("expected %s match %s to be %v, was %v", tc.reference, tc.pattern, tc.expected, actual)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user