github.com/nextlinux/gosbom@v0.81.1-0.20230627115839-1ff50c281391/test/integration/all_layers_squashed_comparison_test.go (about) 1 package integration 2 3 import ( 4 "testing" 5 6 "github.com/nextlinux/gosbom/gosbom/source" 7 ) 8 9 func Test_AllLayersIncludesSquashed(t *testing.T) { 10 // This is a verification test for issue #894 (https://github.com/nextlinux/gosbom/issues/894) 11 allLayers, _ := catalogFixtureImage(t, "image-suse-all-layers", source.AllLayersScope, nil) 12 squashed, _ := catalogFixtureImage(t, "image-suse-all-layers", source.SquashedScope, nil) 13 14 lenAllLayers := len(allLayers.Artifacts.Packages.Sorted()) 15 lenSquashed := len(squashed.Artifacts.Packages.Sorted()) 16 17 if lenAllLayers < lenSquashed { 18 t.Errorf("squashed has more packages than all-layers: %d > %d", lenSquashed, lenAllLayers) 19 } 20 }