aboutsummaryrefslogtreecommitdiff
path: root/plugin/cache
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2018-06-02 19:48:39 +0100
committerGravatar Yong Tang <yong.tang.github@outlook.com> 2018-06-02 11:48:39 -0700
commit22c0b30d5f7468c2477291419bee3e88dfba490c (patch)
tree1454e8de2c457fcc649a7712815a6a980526ee6b /plugin/cache
parent3994d3a5a704aab10aa0e52fac8d60ac872ecaad (diff)
downloadcoredns-22c0b30d5f7468c2477291419bee3e88dfba490c.tar.gz
coredns-22c0b30d5f7468c2477291419bee3e88dfba490c.tar.zst
coredns-22c0b30d5f7468c2477291419bee3e88dfba490c.zip
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.
Diffstat (limited to 'plugin/cache')
-rw-r--r--plugin/cache/cache_test.go2
-rw-r--r--plugin/cache/spoof_test.go6
2 files changed, 4 insertions, 4 deletions
diff --git a/plugin/cache/cache_test.go b/plugin/cache/cache_test.go
index e67521986..c2ab74920 100644
--- a/plugin/cache/cache_test.go
+++ b/plugin/cache/cache_test.go
@@ -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
}
diff --git a/plugin/cache/spoof_test.go b/plugin/cache/spoof_test.go
index 71930f4dc..04d714f4a 100644
--- a/plugin/cache/spoof_test.go
+++ b/plugin/cache/spoof_test.go
@@ -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)
}
}