func TestValidateVersion(t *testing.T) { for _, v := range validVersions { err := deb.ValidateVersion(v) if err != nil { t.Fatalf("Version validation broken for %v", v) } } for _, v := range badVersions { err := deb.ValidateVersion(v) if err == nil { t.Fatalf("Bad Version not detected for %v", v) } } }
func ExampleValidateVersion() { v := "1.0.1-git123" err := deb.ValidateVersion(v) if err != nil { log.Fatalf("Version validation broken for %v", v) } }