Make IsDNS1123Subdomain return error strings
This commit is contained in:
@@ -60,8 +60,8 @@ func TestIsDNS1123Subdomain(t *testing.T) {
|
||||
strings.Repeat("a", 253),
|
||||
}
|
||||
for _, val := range goodValues {
|
||||
if !IsDNS1123Subdomain(val) {
|
||||
t.Errorf("expected true for '%s'", val)
|
||||
if msgs := IsDNS1123Subdomain(val); len(msgs) != 0 {
|
||||
t.Errorf("expected true for '%s': %v", val, msgs)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ func TestIsDNS1123Subdomain(t *testing.T) {
|
||||
strings.Repeat("a", 254),
|
||||
}
|
||||
for _, val := range badValues {
|
||||
if IsDNS1123Subdomain(val) {
|
||||
if msgs := IsDNS1123Subdomain(val); len(msgs) == 0 {
|
||||
t.Errorf("expected false for '%s'", val)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user