mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -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:
@@ -25,21 +25,21 @@ func TestSetup(t *testing.T) {
|
||||
err := setup(c)
|
||||
if err != nil {
|
||||
if !test.failing {
|
||||
t.Fatalf("test %d, expected no errors, but got: %v", i, err)
|
||||
t.Fatalf("Test %d, expected no errors, but got: %v", i, err)
|
||||
}
|
||||
continue
|
||||
}
|
||||
if test.failing {
|
||||
t.Fatalf("test %d, expected to failed but did not, returned values", i)
|
||||
t.Fatalf("Test %d, expected to failed but did not, returned values", i)
|
||||
}
|
||||
cfg := dnsserver.GetConfig(c)
|
||||
if len(cfg.ListenHosts) != len(test.expected) {
|
||||
t.Errorf("test %d : expected the config's ListenHosts size to be %d, was %d", i, len(test.expected), len(cfg.ListenHosts))
|
||||
t.Errorf("Test %d : expected the config's ListenHosts size to be %d, was %d", i, len(test.expected), len(cfg.ListenHosts))
|
||||
continue
|
||||
}
|
||||
for i, v := range test.expected {
|
||||
if got, want := cfg.ListenHosts[i], v; got != want {
|
||||
t.Errorf("test %d : expected the config's ListenHost to be %s, was %s", i, want, got)
|
||||
t.Errorf("Test %d : expected the config's ListenHost to be %s, was %s", i, want, got)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user