(t *testing.T)
| 119 | } |
| 120 | |
| 121 | func TestDispatchUnsupportedVersion(t *testing.T) { |
| 122 | s := &Session{ |
| 123 | send: make(chan any, 10), |
| 124 | uid: types.Uid(1), |
| 125 | authLvl: auth.LevelAuth, |
| 126 | } |
| 127 | wg := sync.WaitGroup{} |
| 128 | r := responses{} |
| 129 | wg.Add(1) |
| 130 | go s.testWriteLoop(&r, &wg) |
| 131 | msg := &ClientComMessage{ |
| 132 | Hi: &MsgClientHi{ |
| 133 | Id: "123", |
| 134 | // Invalid version string. |
| 135 | Version: "0.1", |
| 136 | }, |
| 137 | } |
| 138 | s.dispatch(msg) |
| 139 | close(s.send) |
| 140 | wg.Wait() |
| 141 | verifyResponseCodes(&r, []int{http.StatusHTTPVersionNotSupported}, t) |
| 142 | } |
| 143 | |
| 144 | func TestDispatchLogin(t *testing.T) { |
| 145 | ctrl := gomock.NewController(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…