(t *testing.T)
| 77 | } |
| 78 | |
| 79 | func TestHubUnregisterNonMatchingConn(t *testing.T) { |
| 80 | hub := NewHub() |
| 81 | defer hub.Close() |
| 82 | |
| 83 | _, conn1 := newTestWSPair(t) |
| 84 | _, conn2 := newTestWSPair(t) |
| 85 | |
| 86 | hub.Register("agent1", conn1) |
| 87 | // Unregister with wrong conn should not remove |
| 88 | hub.Unregister("agent1", conn2) |
| 89 | |
| 90 | if !hub.IsConnected("agent1") { |
| 91 | t.Fatal("expected still connected when unregister conn doesn't match") |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | func TestHubRegisterReplacesOld(t *testing.T) { |
| 96 | hub := NewHub() |
nothing calls this directly
no test coverage detected