mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
Signed-off-by: Alex Goodman <alex.goodman@anchore.com> Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
32 lines
562 B
Go
32 lines
562 B
Go
package ruby
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/google/go-cmp/cmp"
|
|
)
|
|
|
|
func Test_packageURL(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
version string
|
|
expected string
|
|
}{
|
|
{
|
|
name: "p",
|
|
version: "v",
|
|
expected: "pkg:gem/p@v",
|
|
},
|
|
}
|
|
|
|
for _, test := range tests {
|
|
t.Run(fmt.Sprintf("%s@%s", test.name, test.version), func(t *testing.T) {
|
|
actual := packageURL(test.name, test.version)
|
|
if diff := cmp.Diff(test.expected, actual); diff != "" {
|
|
t.Errorf("unexpected packageURL (-want +got):\n%s", diff)
|
|
}
|
|
})
|
|
}
|
|
}
|