github.com/anchore/syft@v1.38.2/syft/pkg/cataloger/snap/cataloger_test.go (about)

     1  package snap
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/anchore/syft/syft/pkg/cataloger/internal/pkgtest"
     7  )
     8  
     9  func TestCataloger_Globs(t *testing.T) {
    10  	tests := []struct {
    11  		name    string
    12  		fixture string
    13  	}{
    14  		{
    15  			name:    "base snap with dpkg.yaml",
    16  			fixture: "test-fixtures/glob-paths/base",
    17  		},
    18  		{
    19  			name:    "system snap with manifest.yaml",
    20  			fixture: "test-fixtures/glob-paths/system",
    21  		},
    22  		{
    23  			name:    "snap with meta/snap.yaml",
    24  			fixture: "test-fixtures/glob-paths/meta",
    25  		},
    26  	}
    27  
    28  	for _, test := range tests {
    29  		t.Run(test.name, func(t *testing.T) {
    30  			pkgtest.NewCatalogTester().
    31  				FromDirectory(t, test.fixture).
    32  				IgnoreUnfulfilledPathResponses("**/meta/snap.yaml", "**/usr/share/snappy/dpkg.yaml", "**/doc/linux-modules-*/changelog.Debian.gz", "**/snap/manifest.yaml", "**/snap/snapcraft.yaml").
    33  				TestCataloger(t, NewCataloger())
    34  		})
    35  	}
    36  }