(t *testing.T)
| 96 | } |
| 97 | |
| 98 | func TestDispatchInvalidVersion(t *testing.T) { |
| 99 | s := &Session{ |
| 100 | send: make(chan any, 10), |
| 101 | uid: types.Uid(1), |
| 102 | authLvl: auth.LevelAuth, |
| 103 | } |
| 104 | wg := sync.WaitGroup{} |
| 105 | r := responses{} |
| 106 | wg.Add(1) |
| 107 | go s.testWriteLoop(&r, &wg) |
| 108 | msg := &ClientComMessage{ |
| 109 | Hi: &MsgClientHi{ |
| 110 | Id: "123", |
| 111 | // Invalid version string. |
| 112 | Version: "INVALID VERSION STRING", |
| 113 | }, |
| 114 | } |
| 115 | s.dispatch(msg) |
| 116 | close(s.send) |
| 117 | wg.Wait() |
| 118 | verifyResponseCodes(&r, []int{http.StatusBadRequest}, t) |
| 119 | } |
| 120 | |
| 121 | func TestDispatchUnsupportedVersion(t *testing.T) { |
| 122 | s := &Session{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…