(t *testing.T)
| 269 | } |
| 270 | |
| 271 | func TestDispatchAlreadySubscribed(t *testing.T) { |
| 272 | uid := types.Uid(1) |
| 273 | s := test_makeSession(uid) |
| 274 | wg := sync.WaitGroup{} |
| 275 | r := responses{} |
| 276 | wg.Add(1) |
| 277 | go s.testWriteLoop(&r, &wg) |
| 278 | |
| 279 | msg := &ClientComMessage{ |
| 280 | Sub: &MsgClientSub{ |
| 281 | Id: "123", |
| 282 | Topic: "me", |
| 283 | Get: &MsgGetQuery{ |
| 284 | What: "sub desc tags cred", |
| 285 | }, |
| 286 | }, |
| 287 | } |
| 288 | // Pretend the session's already subscribed to topic 'me'. |
| 289 | s.subs = make(map[string]*Subscription) |
| 290 | s.subs[uid.UserId()] = &Subscription{} |
| 291 | |
| 292 | s.dispatch(msg) |
| 293 | close(s.send) |
| 294 | wg.Wait() |
| 295 | |
| 296 | verifyResponseCodes(&r, []int{http.StatusNotModified}, t) |
| 297 | } |
| 298 | |
| 299 | func TestDispatchSubscribeJoinChannelFull(t *testing.T) { |
| 300 | uid := types.Uid(1) |
nothing calls this directly
no test coverage detected
searching dependent graphs…