mirror of
https://github.com/anchore/syft.git
synced 2026-02-15 03:56:40 +01:00
* chore: bump packageurl-go with new parsing rules * test: update expectedPURL in unit tests to match new % encoding --------- Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
29 lines
463 B
Go
29 lines
463 B
Go
package gentoo
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func Test_packageURL(t *testing.T) {
|
|
|
|
tests := []struct {
|
|
name string
|
|
version string
|
|
want string
|
|
}{
|
|
{
|
|
"app-admin/eselect",
|
|
"1.4.15",
|
|
"pkg:ebuild/app-admin%2Feselect@1.4.15",
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(fmt.Sprintf("%s@%s", tt.name, tt.version), func(t *testing.T) {
|
|
assert.Equal(t, tt.want, packageURL(tt.name, tt.version))
|
|
})
|
|
}
|
|
}
|