mirror of
https://github.com/distribution/distribution.git
synced 2025-09-19 18:02:52 +00:00
reference: TestMatch(): use sub-tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -608,17 +608,21 @@ func TestMatch(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, tc := range tests {
|
for _, tc := range tests {
|
||||||
named, err := ParseAnyReference(tc.reference)
|
tc := tc
|
||||||
if err != nil {
|
t.Run(tc.reference, func(t *testing.T) {
|
||||||
t.Fatal(err)
|
t.Parallel()
|
||||||
}
|
named, err := ParseAnyReference(tc.reference)
|
||||||
actual, err := FamiliarMatch(tc.pattern, named)
|
if err != nil {
|
||||||
if err != nil {
|
t.Fatal(err)
|
||||||
t.Fatal(err)
|
}
|
||||||
}
|
actual, err := FamiliarMatch(tc.pattern, named)
|
||||||
if actual != tc.expected {
|
if err != nil {
|
||||||
t.Fatalf("expected %s match %s to be %v, was %v", tc.reference, tc.pattern, tc.expected, actual)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
if actual != tc.expected {
|
||||||
|
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