syft/syft/pkg/cataloger/swipl/parse_pack_test.go
Laurent Goderre 92d63df6f5
Added the SWI Prolog (swipl) ecosystem (#3076)
* Add binary classifier for swipl

Signed-off-by: Laurent Goderre <laurent.goderre@docker.com>

* Added cataloger for SWI Prolog Pack packages

Signed-off-by: Laurent Goderre <laurent.goderre@docker.com>

---------

Signed-off-by: Laurent Goderre <laurent.goderre@docker.com>
2024-07-31 16:13:26 -04:00

40 lines
1.0 KiB
Go

package swipl
import (
"testing"
"github.com/anchore/syft/syft/artifact"
"github.com/anchore/syft/syft/file"
"github.com/anchore/syft/syft/pkg"
"github.com/anchore/syft/syft/pkg/cataloger/internal/pkgtest"
)
func TestParsePackPackage(t *testing.T) {
fixture := "test-fixtures/pack.pl"
locations := file.NewLocationSet(file.NewLocation(fixture))
expectedPkgs := []pkg.Package{
{
Name: "hdt",
Version: "0.5.2",
PURL: "pkg:swiplpack/hdt@0.5.2",
Locations: locations,
Language: pkg.Swipl,
Type: pkg.SwiplPackPkg,
Metadata: pkg.SwiplPackEntry{
Name: "hdt",
Version: "0.5.2",
Author: "Jan Wielemaker",
AuthorEmail: "J.Wielemaker@vu.nl",
Packager: "Jan Wielemaker",
PackagerEmail: "J.Wielemaker@vu.nl",
Homepage: "https://github.com/JanWielemaker/hdt",
},
},
}
// TODO: no relationships are under test yet
var expectedRelationships []artifact.Relationship
pkgtest.TestFileParser(t, fixture, parsePackPackage, expectedPkgs, expectedRelationships)
}