simplify test assertions + rename file contents cataloger size limiter var

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman
2021-04-12 17:34:56 -04:00
parent 51b13f8221
commit b5d4b2f7b2
3 changed files with 17 additions and 30 deletions
@@ -6,6 +6,8 @@ import (
"io/ioutil"
"testing"
"github.com/stretchr/testify/assert"
"github.com/anchore/syft/syft/pkg"
"github.com/anchore/syft/syft/source"
)
@@ -46,13 +48,8 @@ func TestGenericCataloger(t *testing.T) {
}
actualPkgs, err := cataloger.Catalog(resolver)
if err != nil {
t.Fatalf("cataloger catalog action failed: %+v", err)
}
if len(actualPkgs) != len(expectedPkgs) {
t.Fatalf("unexpected packages len: %d != %d", len(expectedPkgs), len(actualPkgs))
}
assert.NoError(t, err)
assert.Len(t, actualPkgs, len(expectedPkgs))
for _, p := range actualPkgs {
ref := p.Locations[0]