(t *testing.T)
| 409 | } |
| 410 | |
| 411 | func TestDispatchLeaveUnknownTopic(t *testing.T) { |
| 412 | uid := types.Uid(1) |
| 413 | s := test_makeSession(uid) |
| 414 | wg := sync.WaitGroup{} |
| 415 | r := responses{} |
| 416 | wg.Add(1) |
| 417 | go s.testWriteLoop(&r, &wg) |
| 418 | |
| 419 | // Session isn't subscribed to topic 'me'. |
| 420 | // And wants to leave it => no change. |
| 421 | s.subs = make(map[string]*Subscription) |
| 422 | |
| 423 | msg := &ClientComMessage{ |
| 424 | Leave: &MsgClientLeave{ |
| 425 | Id: "123", |
| 426 | Topic: "me", |
| 427 | }, |
| 428 | } |
| 429 | |
| 430 | s.dispatch(msg) |
| 431 | close(s.send) |
| 432 | wg.Wait() |
| 433 | |
| 434 | verifyResponseCodes(&r, []int{http.StatusNotModified}, t) |
| 435 | } |
| 436 | |
| 437 | func TestDispatchLeaveUnsubFromUnknownTopic(t *testing.T) { |
| 438 | uid := types.Uid(1) |
nothing calls this directly
no test coverage detected
searching dependent graphs…