mirror of
https://github.com/soheilhy/cmux.git
synced 2024-11-10 11:41:52 +08:00
DRY
This commit is contained in:
parent
b5e73ea381
commit
5746da9df6
17
cmux_test.go
17
cmux_test.go
@ -116,22 +116,7 @@ func TestAny(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
r, err := http.Get("http://" + l.Addr().String())
|
runTestHTTP1Client(t, l.Addr())
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
defer func() {
|
|
||||||
if err := r.Body.Close(); err != nil {
|
|
||||||
t.Log(err)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
b, err := ioutil.ReadAll(r.Body)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
if string(b) != testHTTP1Resp {
|
|
||||||
t.Errorf("invalid response: want=%s got=%s", testHTTP1Resp, b)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestHTTPGoRPC(t *testing.T) {
|
func TestHTTPGoRPC(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user