github.com/anchore/syft@v1.38.2/syft/pkg/cataloger/binary/pe_package_test.go (about)

     1  package binary
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/anchore/syft/syft/file"
     7  )
     8  
     9  func TestGhostscriptPEGeneratesGenericPURL(t *testing.T) {
    10  	vr := map[string]string{
    11  		"CompanyName":     "Artifex Software, Inc.",
    12  		"ProductName":     "GPL Ghostscript",
    13  		"FileDescription": "Ghostscript Interpreter",
    14  		"ProductVersion":  "9.54.0",
    15  	}
    16  
    17  	loc := file.NewLocation("/usr/bin/gswin64c.exe")
    18  	p := newPEPackage(vr, loc)
    19  
    20  	expected := "pkg:generic/ghostscript@9.54.0"
    21  	if p.PURL != expected {
    22  		t.Fatalf("expected purl %q, got %q", expected, p.PURL)
    23  	}
    24  }