mirror of
https://github.com/anchore/syft
synced 2024-11-13 23:57:07 +00:00
5f3d4d285b
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
22 lines
495 B
Go
22 lines
495 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, []string{"all"})
|
|
|
|
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)
|
|
}
|
|
}
|