github.com/noqcks/syft@v0.0.0-20230920222752-a9e2c4e288e5/test/integration/regression_apk_scanner_buffer_size_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 TestRegression212ApkBufferSize(t *testing.T) { 11 // This is a regression test for issue #212 (https://github.com/anchore/syft/issues/212) in which the apk db could 12 // not be processed due to a scanner buffer that was too small 13 sbom, _ := catalogFixtureImage(t, "image-large-apk-data", source.SquashedScope, nil) 14 15 expectedPkgs := 58 16 actualPkgs := 0 17 for range sbom.Artifacts.Packages.Enumerate(pkg.ApkPkg) { 18 actualPkgs += 1 19 } 20 21 if actualPkgs != expectedPkgs { 22 t.Errorf("unexpected number of APK packages: %d != %d", expectedPkgs, actualPkgs) 23 } 24 }