mirror of
https://github.com/safedep/vet.git
synced 2025-12-10 00:22:08 -06:00
27 lines
487 B
Go
27 lines
487 B
Go
package parser
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestListParser(t *testing.T) {
|
|
parsers := List()
|
|
assert.Equal(t, 10, 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())
|
|
})
|
|
}
|
|
}
|