diff --git a/params/version_test.go b/params/version_test.go new file mode 100644 index 000000000..a210b8fc7 --- /dev/null +++ b/params/version_test.go @@ -0,0 +1,19 @@ +package params_test + +import ( + "io/ioutil" + "path/filepath" + "regexp" + "testing" +) + +func TestVersionFormat(t *testing.T) { + data, err := ioutil.ReadFile(filepath.Join("..", "VERSION")) + if err != nil { + t.Error("unable to open VERSION file") + } + matched, _ := regexp.Match(`^\d+\.\d+\.\d+(-[.\w]+)?\n?$`, data) + if !matched { + t.Error("version in incorrect format") + } +}