Make IsQualifiedName return error strings

This commit is contained in:
Tim Hockin
2015-12-15 21:28:42 -08:00
parent f6eefd4762
commit 72955770f3
11 changed files with 102 additions and 72 deletions

View File

@@ -222,8 +222,8 @@ func TestIsQualifiedName(t *testing.T) {
strings.Repeat("a", 253) + "/" + strings.Repeat("b", 63),
}
for i := range successCases {
if !IsQualifiedName(successCases[i]) {
t.Errorf("case[%d]: %q: expected success", i, successCases[i])
if errs := IsQualifiedName(successCases[i]); len(errs) != 0 {
t.Errorf("case[%d]: %q: expected success: %v", i, successCases[i], errs)
}
}
@@ -240,7 +240,7 @@ func TestIsQualifiedName(t *testing.T) {
strings.Repeat("a", 254) + "/abc",
}
for i := range errorCases {
if IsQualifiedName(errorCases[i]) {
if errs := IsQualifiedName(errorCases[i]); len(errs) == 0 {
t.Errorf("case[%d]: %q: expected failure", i, errorCases[i])
}
}