зеркало из https://github.com/microsoft/docker.git
Merge pull request #28365 from wefine/fix-t-errorf
fix t.Errorf to t.Error in serveral _test.go
This commit is contained in:
Коммит
21051de6e1
|
@ -23,10 +23,10 @@ func TestParseArgs(t *testing.T) {
|
|||
}
|
||||
}
|
||||
if len(args.Get("created")) != 1 {
|
||||
t.Errorf("failed to set this arg")
|
||||
t.Error("failed to set this arg")
|
||||
}
|
||||
if len(args.Get("image.name")) != 2 {
|
||||
t.Errorf("the args should have collapsed")
|
||||
t.Error("the args should have collapsed")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ func TestEmpty(t *testing.T) {
|
|||
t.Errorf("%s", err)
|
||||
}
|
||||
if a.Len() != v1.Len() {
|
||||
t.Errorf("these should both be empty sets")
|
||||
t.Error("these should both be empty sets")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -102,11 +102,11 @@ func TestNewEnvClient(t *testing.T) {
|
|||
// pedantic checking that this is handled correctly
|
||||
tr := apiclient.client.Transport.(*http.Transport)
|
||||
if tr.TLSClientConfig == nil {
|
||||
t.Errorf("no tls config found when DOCKER_TLS_VERIFY enabled")
|
||||
t.Error("no tls config found when DOCKER_TLS_VERIFY enabled")
|
||||
}
|
||||
|
||||
if tr.TLSClientConfig.InsecureSkipVerify {
|
||||
t.Errorf("tls verification should be enabled")
|
||||
t.Error("tls verification should be enabled")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,6 @@ import (
|
|||
|
||||
func TestLibVersion(t *testing.T) {
|
||||
if btrfsLibVersion() <= 0 {
|
||||
t.Errorf("expected output from btrfs lib version > 0")
|
||||
t.Error("expected output from btrfs lib version > 0")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ func TestNoneHealthcheck(t *testing.T) {
|
|||
|
||||
daemon.initHealthMonitor(c)
|
||||
if c.State.Health != nil {
|
||||
t.Errorf("Expecting Health to be nil, but was not")
|
||||
t.Error("Expecting Health to be nil, but was not")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ func TestMapOpts(t *testing.T) {
|
|||
t.Errorf("max-size = %s != 1", tmpMap["max-size"])
|
||||
}
|
||||
if o.Set("dummy-val=3") == nil {
|
||||
t.Errorf("validator is not being called")
|
||||
t.Error("validator is not being called")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,6 @@ func TestDetectContentType(t *testing.T) {
|
|||
input := []byte("That is just a plain text")
|
||||
|
||||
if contentType, _, err := DetectContentType(input); err != nil || contentType != "text/plain" {
|
||||
t.Errorf("TestDetectContentType failed")
|
||||
t.Error("TestDetectContentType failed")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -229,7 +229,7 @@ func TestResumableRequestReaderWithZeroTotalSize(t *testing.T) {
|
|||
resstr := strings.TrimSuffix(string(data), "\n")
|
||||
|
||||
if resstr != srvtxt {
|
||||
t.Errorf("resstr != srvtxt")
|
||||
t.Error("resstr != srvtxt")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -263,7 +263,7 @@ func TestResumableRequestReader(t *testing.T) {
|
|||
resstr := strings.TrimSuffix(string(data), "\n")
|
||||
|
||||
if resstr != srvtxt {
|
||||
t.Errorf("resstr != srvtxt")
|
||||
t.Error("resstr != srvtxt")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -302,6 +302,6 @@ func TestResumableRequestReaderWithInitialResponse(t *testing.T) {
|
|||
resstr := strings.TrimSuffix(string(data), "\n")
|
||||
|
||||
if resstr != srvtxt {
|
||||
t.Errorf("resstr != srvtxt")
|
||||
t.Error("resstr != srvtxt")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ func TestSortFileInfoSums(t *testing.T) {
|
|||
fis = newFileInfoSums()
|
||||
fis.SortByPos()
|
||||
if fis[0].Pos() != 0 {
|
||||
t.Errorf("sorted fileInfoSums by Pos should order them by position.")
|
||||
t.Error("sorted fileInfoSums by Pos should order them by position.")
|
||||
}
|
||||
|
||||
fis = newFileInfoSums()
|
||||
|
@ -56,7 +56,7 @@ func TestSortFileInfoSums(t *testing.T) {
|
|||
t.Errorf("Expected %q, got %q", expected, gotFileInfoSum)
|
||||
}
|
||||
if fis.GetFile("noPresent") != nil {
|
||||
t.Errorf("Should have return nil if name not found.")
|
||||
t.Error("Should have return nil if name not found.")
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче