mirror of
https://github.com/anchore/syft.git
synced 2026-03-30 13:43:25 +02:00
* internalize majority of cmd package and migrate integration tests Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * add internal api encoder Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * create internal representation of all formats Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * export capability to get default encoders Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * restore test fixtures Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> --------- Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
23 lines
478 B
Go
23 lines
478 B
Go
package integration
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/anchore/syft/syft/pkg"
|
|
"github.com/anchore/syft/syft/source"
|
|
)
|
|
|
|
func TestRustAudit(t *testing.T) {
|
|
sbom, _ := catalogFixtureImage(t, "image-rust-auditable", source.SquashedScope)
|
|
|
|
expectedPkgs := 2
|
|
actualPkgs := 0
|
|
for range sbom.Artifacts.Packages.Enumerate(pkg.RustPkg) {
|
|
actualPkgs += 1
|
|
}
|
|
|
|
if actualPkgs != expectedPkgs {
|
|
t.Errorf("unexpected number of Rust packages: %d != %d", expectedPkgs, actualPkgs)
|
|
}
|
|
}
|