github.com/anchore/syft@v1.38.2/syft/pkg/cataloger/swipl/parse_pack_test.go (about)

     1  package swipl
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/anchore/syft/syft/artifact"
     7  	"github.com/anchore/syft/syft/file"
     8  	"github.com/anchore/syft/syft/pkg"
     9  	"github.com/anchore/syft/syft/pkg/cataloger/internal/pkgtest"
    10  )
    11  
    12  func TestParsePackPackage(t *testing.T) {
    13  	fixture := "test-fixtures/pack.pl"
    14  	locations := file.NewLocationSet(file.NewLocation(fixture))
    15  	expectedPkgs := []pkg.Package{
    16  		{
    17  			Name:      "hdt",
    18  			Version:   "0.5.2",
    19  			PURL:      "pkg:swiplpack/hdt@0.5.2",
    20  			Locations: locations,
    21  			Language:  pkg.Swipl,
    22  			Type:      pkg.SwiplPackPkg,
    23  			Metadata: pkg.SwiplPackEntry{
    24  				Name:          "hdt",
    25  				Version:       "0.5.2",
    26  				Author:        "Jan Wielemaker",
    27  				AuthorEmail:   "J.Wielemaker@vu.nl",
    28  				Packager:      "Jan Wielemaker",
    29  				PackagerEmail: "J.Wielemaker@vu.nl",
    30  				Homepage:      "https://github.com/JanWielemaker/hdt",
    31  			},
    32  		},
    33  	}
    34  
    35  	// TODO: no relationships are under test yet
    36  	var expectedRelationships []artifact.Relationship
    37  
    38  	pkgtest.TestFileParser(t, fixture, parsePackPackage, expectedPkgs, expectedRelationships)
    39  }