diff options
Diffstat (limited to 'service')
-rw-r--r-- | service/container_test.go | 4 | ||||
-rw-r--r-- | service/http/h2c_test.go | 7 | ||||
-rw-r--r-- | service/http/handler_test.go | 5 |
3 files changed, 12 insertions, 4 deletions
diff --git a/service/container_test.go b/service/container_test.go index ad4c1e64..5350de41 100644 --- a/service/container_test.go +++ b/service/container_test.go @@ -456,9 +456,7 @@ func TestContainer_NoInit(t *testing.T) { assert.NoError(t, c.Init(&testCfg{`{"test":"something", "test2":"something-else"}`})) } -type testInitD struct { - c *testInitC -} +type testInitD struct {} type DCfg struct { V string diff --git a/service/http/h2c_test.go b/service/http/h2c_test.go index e2669845..7bbc30ac 100644 --- a/service/http/h2c_test.go +++ b/service/http/h2c_test.go @@ -36,7 +36,12 @@ func Test_Service_H2C(t *testing.T) { // should do nothing s.(*Service).Stop() - go func() { c.Serve() }() + go func() { + err := c.Serve() + if err != nil { + t.Errorf("error serving: %v", err) + } + }() time.Sleep(time.Millisecond * 100) defer c.Stop() diff --git a/service/http/handler_test.go b/service/http/handler_test.go index 4efcdd00..994a663c 100644 --- a/service/http/handler_test.go +++ b/service/http/handler_test.go @@ -1043,6 +1043,7 @@ func TestHandler_Multipart_POST(t *testing.T) { } err = w.WriteField("arr[x][y][e]", "f") + if err != nil { t.Errorf("error writing the field: error %v", err) } @@ -1138,6 +1139,7 @@ func TestHandler_Multipart_PUT(t *testing.T) { } err = w.WriteField("name[]", "name1") + if err != nil { t.Errorf("error writing the field: error %v", err) } @@ -1234,6 +1236,7 @@ func TestHandler_Multipart_PATCH(t *testing.T) { go func() { err := hs.ListenAndServe() + if err != nil && err != http.ErrServerClosed { t.Errorf("error listening the interface: error %v", err) } @@ -1258,11 +1261,13 @@ func TestHandler_Multipart_PATCH(t *testing.T) { } err = w.WriteField("name[]", "name2") + if err != nil { t.Errorf("error writing the field: error %v", err) } err = w.WriteField("name[]", "name3") + if err != nil { t.Errorf("error writing the field: error %v", err) } |