github.com/noqcks/syft@v0.0.0-20230920222752-a9e2c4e288e5/syft/pkg/cataloger/haskell/cataloger_test.go (about)

     1  package haskell
     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  		expected []string
    14  	}{
    15  		{
    16  			name:    "obtain stack and cabal files",
    17  			fixture: "test-fixtures/glob-paths",
    18  			expected: []string{
    19  				"src/stack.yaml",
    20  				"src/stack.yaml.lock",
    21  				"src/cabal.project.freeze",
    22  			},
    23  		},
    24  	}
    25  
    26  	for _, test := range tests {
    27  		t.Run(test.name, func(t *testing.T) {
    28  			pkgtest.NewCatalogTester().
    29  				FromDirectory(t, test.fixture).
    30  				ExpectsResolverContentQueries(test.expected).
    31  				TestCataloger(t, NewHackageCataloger())
    32  		})
    33  	}
    34  }