mirror of
https://github.com/coredns/coredns.git
synced 2025-10-30 09:43:17 -04: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:
2
plugin/cache/cache_test.go
vendored
2
plugin/cache/cache_test.go
vendored
@@ -175,7 +175,7 @@ func TestCache(t *testing.T) {
|
||||
ok := i != nil
|
||||
|
||||
if ok != tc.shouldCache {
|
||||
t.Errorf("cached message that should not have been cached: %s", state.Name())
|
||||
t.Errorf("Cached message that should not have been cached: %s", state.Name())
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
6
plugin/cache/spoof_test.go
vendored
6
plugin/cache/spoof_test.go
vendored
@@ -24,7 +24,7 @@ func TestSpoof(t *testing.T) {
|
||||
|
||||
qname := rec.Msg.Question[0].Name
|
||||
if c.pcache.Len() != 0 {
|
||||
t.Errorf("cached %s, while reply had %s", "example.org.", qname)
|
||||
t.Errorf("Cached %s, while reply had %s", "example.org.", qname)
|
||||
}
|
||||
|
||||
// qtype
|
||||
@@ -35,7 +35,7 @@ func TestSpoof(t *testing.T) {
|
||||
|
||||
qtype := rec.Msg.Question[0].Qtype
|
||||
if c.pcache.Len() != 0 {
|
||||
t.Errorf("cached %s type %d, while reply had %d", "example.org.", dns.TypeMX, qtype)
|
||||
t.Errorf("Cached %s type %d, while reply had %d", "example.org.", dns.TypeMX, qtype)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ func TestResponse(t *testing.T) {
|
||||
c.ServeDNS(context.TODO(), rec, req)
|
||||
|
||||
if c.pcache.Len() != 0 {
|
||||
t.Errorf("cached %s, while reply had response set to %t", "example.net.", rec.Msg.Response)
|
||||
t.Errorf("Cached %s, while reply had response set to %t", "example.net.", rec.Msg.Response)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user