add vcs tests

This commit is contained in:
Serge Zaitsev
2018-09-21 15:06:56 +02:00
parent f67e23486c
commit 0f6ba760df
2 changed files with 152 additions and 0 deletions

18
pkg/vcs/vcs_test.go Normal file
View File

@@ -0,0 +1,18 @@
package vcs
import "testing"
func TestVersion(t *testing.T) {
if !Version("v1.0.0").IsSemVer() {
t.Fatal()
}
if Version("1.0.0").IsSemVer() {
t.Fatal()
}
if Version("v0.0.0-20180910181607-0e37d006457b").IsSemVer() {
t.Fatal()
}
if Version("v0.0.0-20180910181607-0e37d006457b").Hash() != "0e37d006457b" {
t.Fatal()
}
}