vet/pkg/parser/parser_test.go
abhisek ce10afab06
Add auth persistence
Add parser and models

Add parser in scanner

Add enrichment

Use pointer for package ref

Add work queue for concurrent enrichment

Update enrich

Misc refactoring

Update README

Refactored lockfile parsers

Add analyzers

Update json dumper

Refactor scan
2023-01-02 16:13:41 +05:30

27 lines
487 B
Go

package parser
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestListParser(t *testing.T) {
parsers := List()
assert.Equal(t, 14, len(parsers))
}
func TestInvalidEcosystemMapping(t *testing.T) {
pw := &parserWrapper{parseAs: "nothing"}
assert.Empty(t, pw.Ecosystem())
}
func TestEcosystemMapping(t *testing.T) {
for _, lf := range List() {
t.Run(lf, func(t *testing.T) {
pw := &parserWrapper{parseAs: lf}
assert.NotEmpty(t, pw.Ecosystem())
})
}
}