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:
Miek Gieben
2018-05-07 22:47:25 +01:00
committed by Yong Tang
parent 15d989e294
commit 643550eabe
25 changed files with 104 additions and 90 deletions

View File

@@ -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)
}
}
}