syft/syft/pkg/cataloger/ocaml/package_test.go
Laurent Goderre 9c2799e379
Add the Ocaml ecosystem (#3112)
Signed-off-by: Laurent Goderre <laurent.goderre@docker.com>
2024-09-10 10:35:18 -04:00

35 lines
546 B
Go

package ocaml
import (
"testing"
"github.com/stretchr/testify/assert"
)
func Test_packageURL(t *testing.T) {
type args struct {
name string
version string
}
tests := []struct {
name string
args args
want string
}{
{
name: "go case",
args: args{
name: "ocaml-base-compiler",
version: "5.2.0",
},
want: "pkg:opam/ocaml-base-compiler@5.2.0",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
assert.Equal(t, tt.want, opamPackageURL(tt.args.name, tt.args.version))
})
}
}