2023-03-10 13:37:29 -05:00
|
|
|
package common_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
. "github.com/smartystreets/goconvey/convey"
|
|
|
|
|
2023-03-28 12:20:09 -05:00
|
|
|
"zotregistry.io/zot/pkg/meta/common"
|
2023-03-10 13:37:29 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestUtils(t *testing.T) {
|
|
|
|
Convey("GetReferredSubject", t, func() {
|
|
|
|
_, err := common.GetReferredSubject([]byte("bad json"))
|
|
|
|
So(err, ShouldNotBeNil)
|
|
|
|
})
|
|
|
|
|
|
|
|
Convey("MatchesArtifactTypes", t, func() {
|
|
|
|
res := common.MatchesArtifactTypes("", nil)
|
|
|
|
So(res, ShouldBeTrue)
|
|
|
|
|
|
|
|
res = common.MatchesArtifactTypes("type", []string{"someOtherType"})
|
|
|
|
So(res, ShouldBeFalse)
|
|
|
|
})
|
|
|
|
}
|