(t *testing.T)
| 191 | } |
| 192 | |
| 193 | func TestClientSubscribeInvalidArg(t *testing.T) { |
| 194 | server := newTestServer("service", new(Service)) |
| 195 | defer server.Stop() |
| 196 | client := DialInProc(server) |
| 197 | defer client.Close() |
| 198 | |
| 199 | check := func(shouldPanic bool, arg interface{}) { |
| 200 | defer func() { |
| 201 | err := recover() |
| 202 | if shouldPanic && err == nil { |
| 203 | t.Errorf("EthSubscribe should've panicked for %#v", arg) |
| 204 | } |
| 205 | if !shouldPanic && err != nil { |
| 206 | t.Errorf("EthSubscribe shouldn't have panicked for %#v", arg) |
| 207 | buf := make([]byte, 1024*1024) |
| 208 | buf = buf[:runtime.Stack(buf, false)] |
| 209 | t.Error(err) |
| 210 | t.Error(string(buf)) |
| 211 | } |
| 212 | }() |
| 213 | client.EthSubscribe(context.Background(), arg, "foo_bar") |
| 214 | } |
| 215 | check(true, nil) |
| 216 | check(true, 1) |
| 217 | check(true, (chan int)(nil)) |
| 218 | check(true, make(<-chan int)) |
| 219 | check(false, make(chan int)) |
| 220 | check(false, make(chan<- int)) |
| 221 | } |
| 222 | |
| 223 | func TestClientSubscribe(t *testing.T) { |
| 224 | server := newTestServer("eth", new(NotificationTestService)) |
nothing calls this directly
no test coverage detected