add tests around MatchNamedCaptureGroups + rename

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman
2021-04-12 17:08:50 -04:00
parent 66ebe49a04
commit 5743e32e02
7 changed files with 113 additions and 19 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ func parseGemSpecEntries(_ string, reader io.Reader) ([]pkg.Package, error) {
}
for field, pattern := range patterns {
matchMap := internal.MatchCaptureGroups(pattern, sanitizedLine)
matchMap := internal.MatchNamedCaptureGroups(pattern, sanitizedLine)
if value := matchMap[field]; value != "" {
if postProcessor := postProcessors[field]; postProcessor != nil {
fields[field] = postProcessor(value)