mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 18:53:43 -04:00
presubmit: check for uppercase (#1774)
Another thing we can test automatically, we sorta settled on using an uppercase letter in in t.Log and t.Fatal calls. Let's just check for this.
This commit is contained in:
@@ -19,7 +19,7 @@ func TestZoneSigningBlackLies(t *testing.T) {
|
||||
state := request.Request{Req: m, Zone: "miek.nl."}
|
||||
m = d.Sign(state, time.Now().UTC(), server)
|
||||
if !section(m.Ns, 2) {
|
||||
t.Errorf("authority section should have 2 sig")
|
||||
t.Errorf("Authority section should have 2 sigs")
|
||||
}
|
||||
var nsec *dns.NSEC
|
||||
for _, r := range m.Ns {
|
||||
@@ -28,16 +28,16 @@ func TestZoneSigningBlackLies(t *testing.T) {
|
||||
}
|
||||
}
|
||||
if m.Rcode != dns.RcodeSuccess {
|
||||
t.Errorf("expected rcode %d, got %d", dns.RcodeSuccess, m.Rcode)
|
||||
t.Errorf("Expected rcode %d, got %d", dns.RcodeSuccess, m.Rcode)
|
||||
}
|
||||
if nsec == nil {
|
||||
t.Fatalf("expected NSEC, got none")
|
||||
t.Fatalf("Expected NSEC, got none")
|
||||
}
|
||||
if nsec.Hdr.Name != "ww.miek.nl." {
|
||||
t.Errorf("expected %s, got %s", "ww.miek.nl.", nsec.Hdr.Name)
|
||||
t.Errorf("Expected %s, got %s", "ww.miek.nl.", nsec.Hdr.Name)
|
||||
}
|
||||
if nsec.NextDomain != "\\000.ww.miek.nl." {
|
||||
t.Errorf("expected %s, got %s", "\\000.ww.miek.nl.", nsec.NextDomain)
|
||||
t.Errorf("Expected %s, got %s", "\\000.ww.miek.nl.", nsec.NextDomain)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ func TestCacheSet(t *testing.T) {
|
||||
|
||||
dnskey, err := ParseKeyFile(fPub, fPriv)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to parse key: %v\n", err)
|
||||
t.Fatalf("Failed to parse key: %v\n", err)
|
||||
}
|
||||
|
||||
c := cache.New(defaultCap)
|
||||
@@ -29,7 +29,7 @@ func TestCacheSet(t *testing.T) {
|
||||
|
||||
_, ok := d.get(k, server)
|
||||
if !ok {
|
||||
t.Errorf("signature was not added to the cache")
|
||||
t.Errorf("Signature was not added to the cache")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ func TestCacheNotValidExpired(t *testing.T) {
|
||||
|
||||
dnskey, err := ParseKeyFile(fPub, fPriv)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to parse key: %v\n", err)
|
||||
t.Fatalf("Failed to parse key: %v\n", err)
|
||||
}
|
||||
|
||||
c := cache.New(defaultCap)
|
||||
@@ -53,7 +53,7 @@ func TestCacheNotValidExpired(t *testing.T) {
|
||||
|
||||
_, ok := d.get(k, server)
|
||||
if ok {
|
||||
t.Errorf("signature was added to the cache even though not valid")
|
||||
t.Errorf("Signature was added to the cache even though not valid")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ func TestCacheNotValidYet(t *testing.T) {
|
||||
|
||||
dnskey, err := ParseKeyFile(fPub, fPriv)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to parse key: %v\n", err)
|
||||
t.Fatalf("Failed to parse key: %v\n", err)
|
||||
}
|
||||
|
||||
c := cache.New(defaultCap)
|
||||
@@ -77,6 +77,6 @@ func TestCacheNotValidYet(t *testing.T) {
|
||||
|
||||
_, ok := d.get(k, server)
|
||||
if ok {
|
||||
t.Errorf("signature was added to the cache even though not valid yet")
|
||||
t.Errorf("Signature was added to the cache even though not valid yet")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ func newKey(t *testing.T) (*DNSKEY, func(), func()) {
|
||||
|
||||
key, err := ParseKeyFile(fPub, fPriv)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to parse key: %v\n", err)
|
||||
t.Fatalf("Failed to parse key: %v\n", err)
|
||||
}
|
||||
return key, rmPriv, rmPub
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user