|
@@ -6,7 +6,6 @@ import (
|
|
|
"net/http/httptest"
|
|
|
"net/url"
|
|
|
"testing"
|
|
|
- "time"
|
|
|
|
|
|
"github.com/gohxs/prettylog"
|
|
|
"golang.org/x/net/websocket"
|
|
@@ -71,8 +70,8 @@ func TestError(t *testing.T) {
|
|
|
ws := prepareClient(t)
|
|
|
|
|
|
cli := wsrpc.NewClient(ws)
|
|
|
-
|
|
|
go cli.Process()
|
|
|
+
|
|
|
_, err := cli.Call("nomethod", 1, 2, 3, 4)
|
|
|
if err == nil {
|
|
|
t.Fatal("It should return an error but didn't")
|
|
@@ -81,7 +80,6 @@ func TestError(t *testing.T) {
|
|
|
if err != nil {
|
|
|
t.Fatal("Ups")
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
//////////////////////
|
|
@@ -100,9 +98,6 @@ func cliTest(ws *wsrpc.ClientCtx) {
|
|
|
})
|
|
|
|
|
|
ready <- struct{}{}
|
|
|
-
|
|
|
- <-time.After(10 * time.Second)
|
|
|
- ws.WS.Close()
|
|
|
}
|
|
|
|
|
|
func prepareClient(t *testing.T) *websocket.Conn {
|