mirror of
https://github.com/anchore/syft.git
synced 2025-11-22 02:43:19 +01:00
Signed-off-by: Alex Goodman <alex.goodman@anchore.com> Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
40 lines
988 B
Go
40 lines
988 B
Go
package cpp
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/anchore/syft/syft/artifact"
|
|
"github.com/anchore/syft/syft/pkg"
|
|
"github.com/anchore/syft/syft/pkg/cataloger/internal/pkgtest"
|
|
"github.com/anchore/syft/syft/source"
|
|
)
|
|
|
|
func TestParseConanlock(t *testing.T) {
|
|
fixture := "test-fixtures/conan.lock"
|
|
expected := []pkg.Package{
|
|
{
|
|
Name: "zlib",
|
|
Version: "1.2.12",
|
|
PURL: "pkg:conan/zlib@1.2.12",
|
|
Locations: source.NewLocationSet(source.NewLocation(fixture)),
|
|
Language: pkg.CPP,
|
|
Type: pkg.ConanPkg,
|
|
MetadataType: pkg.ConanLockMetadataType,
|
|
Metadata: pkg.ConanLockMetadata{
|
|
Ref: "zlib/1.2.12",
|
|
Options: map[string]string{
|
|
"fPIC": "True",
|
|
"shared": "False",
|
|
},
|
|
Path: "all/conanfile.py",
|
|
Context: "host",
|
|
},
|
|
},
|
|
}
|
|
|
|
// TODO: relationships are not under test
|
|
var expectedRelationships []artifact.Relationship
|
|
|
|
pkgtest.TestFileParser(t, fixture, parseConanlock, expected, expectedRelationships)
|
|
}
|