Browse Source

read from ErrorsCh also

pull/456/head
Anton Kaliaev 8 years ago
parent
commit
720b74d89e
No known key found for this signature in database GPG Key ID: 7B6881D965918214
1 changed files with 12 additions and 8 deletions
  1. +12
    -8
      rpc_test.go

+ 12
- 8
rpc_test.go View File

@ -140,16 +140,20 @@ func testWS(t *testing.T, cl *client.WSClient) {
t.Fatal(err)
}
msg := <-cl.ResultsCh
result := new(Result)
wire.ReadJSONPtr(result, msg, &err)
if err != nil {
select {
case msg := <-cl.ResultsCh:
result := new(Result)
wire.ReadJSONPtr(result, msg, &err)
if err != nil {
t.Fatal(err)
}
got := (*result).(*ResultStatus).Value
if got != val {
t.Fatalf("Got: %v .... Expected: %v \n", got, val)
}
case err := <-cl.ErrorsCh:
t.Fatal(err)
}
got := (*result).(*ResultStatus).Value
if got != val {
t.Fatalf("Got: %v .... Expected: %v \n", got, val)
}
}
//-------------


Loading…
Cancel
Save