mirror of
https://github.com/coredns/coredns.git
synced 2025-12-06 10:25:10 -05:00
presubmit: Check errorf as well (#1845)
Uppercase all these test errors as well. And extend the presubmit to check for these in the future. Also do a slightly smarter grep to only get t.<something>. as (because dump regexp) this also grep over non test files.
This commit is contained in:
@@ -28,7 +28,7 @@ func TestCnameLookup(t *testing.T) {
|
||||
rec := dnstest.NewRecorder(&test.ResponseWriter{})
|
||||
_, err := etc.ServeDNS(ctxt, rec, m)
|
||||
if err != nil {
|
||||
t.Errorf("expected no error, got %v\n", err)
|
||||
t.Errorf("Expected no error, got %v\n", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ func TestGroupLookup(t *testing.T) {
|
||||
rec := dnstest.NewRecorder(&test.ResponseWriter{})
|
||||
_, err := etc.ServeDNS(ctxt, rec, m)
|
||||
if err != nil {
|
||||
t.Errorf("expected no error, got %v\n", err)
|
||||
t.Errorf("Expected no error, got %v\n", err)
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ func TestMultiLookup(t *testing.T) {
|
||||
rec := dnstest.NewRecorder(&test.ResponseWriter{})
|
||||
_, err := etc.ServeDNS(ctxt, rec, m)
|
||||
if err != nil {
|
||||
t.Errorf("expected no error, got %v\n", err)
|
||||
t.Errorf("Expected no error, got %v\n", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ func TestOtherLookup(t *testing.T) {
|
||||
rec := dnstest.NewRecorder(&test.ResponseWriter{})
|
||||
_, err := etc.ServeDNS(ctxt, rec, m)
|
||||
if err != nil {
|
||||
t.Errorf("expected no error, got %v\n", err)
|
||||
t.Errorf("Expected no error, got %v\n", err)
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ func TestStubLookup(t *testing.T) {
|
||||
continue
|
||||
}
|
||||
if err != nil {
|
||||
t.Errorf("expected no error, got %v for %s\n", err, m.Question[0].Name)
|
||||
t.Errorf("Expected no error, got %v for %s\n", err, m.Question[0].Name)
|
||||
}
|
||||
resp := rec.Msg
|
||||
if resp == nil {
|
||||
|
||||
Reference in New Issue
Block a user