github.com/noqcks/syft@v0.0.0-20230920222752-a9e2c4e288e5/test/integration/rust_audit_binary_test.go (about) 1 package integration 2 3 import ( 4 "testing" 5 6 "github.com/anchore/syft/syft/pkg" 7 "github.com/anchore/syft/syft/source" 8 ) 9 10 func TestRustAudit(t *testing.T) { 11 sbom, _ := catalogFixtureImage(t, "image-rust-auditable", source.SquashedScope, []string{"all"}) 12 13 expectedPkgs := 2 14 actualPkgs := 0 15 for range sbom.Artifacts.Packages.Enumerate(pkg.RustPkg) { 16 actualPkgs += 1 17 } 18 19 if actualPkgs != expectedPkgs { 20 t.Errorf("unexpected number of Rust packages: %d != %d", expectedPkgs, actualPkgs) 21 } 22 }