(t *testing.T)
| 207 | } |
| 208 | |
| 209 | func TestDecoderErrRecvChan(t *testing.T) { |
| 210 | s := RunDefaultServer() |
| 211 | defer s.Shutdown() |
| 212 | |
| 213 | ec := NewEConn(t) |
| 214 | defer ec.Close() |
| 215 | nc := ec.Conn |
| 216 | wch := make(chan bool) |
| 217 | |
| 218 | nc.Opts.AsyncErrorCB = func(c *nats.Conn, s *nats.Subscription, e error) { |
| 219 | wch <- true |
| 220 | } |
| 221 | |
| 222 | ch := make(chan *int32) |
| 223 | |
| 224 | if _, err := ec.BindRecvChan("foo", ch); err != nil { |
| 225 | t.Fatalf("Failed to bind to a send channel: %v\n", err) |
| 226 | } |
| 227 | |
| 228 | ec.Publish("foo", "Hello World") |
| 229 | |
| 230 | if e := Wait(wch); e != nil { |
| 231 | t.Fatal("Failed to call async err handler") |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | func TestRecvChanPanicOnClosedChan(t *testing.T) { |
| 236 | s := RunDefaultServer() |
nothing calls this directly
no test coverage detected