(t *testing.T)
| 169 | } |
| 170 | |
| 171 | func TestCloseStatus(t *testing.T) { |
| 172 | t.Parallel() |
| 173 | |
| 174 | testCases := []struct { |
| 175 | name string |
| 176 | in error |
| 177 | exp StatusCode |
| 178 | }{ |
| 179 | { |
| 180 | name: "nil", |
| 181 | in: nil, |
| 182 | exp: -1, |
| 183 | }, |
| 184 | { |
| 185 | name: "io.EOF", |
| 186 | in: io.EOF, |
| 187 | exp: -1, |
| 188 | }, |
| 189 | { |
| 190 | name: "StatusInternalError", |
| 191 | in: CloseError{ |
| 192 | Code: StatusInternalError, |
| 193 | }, |
| 194 | exp: StatusInternalError, |
| 195 | }, |
| 196 | } |
| 197 | |
| 198 | for _, tc := range testCases { |
| 199 | tc := tc |
| 200 | t.Run(tc.name, func(t *testing.T) { |
| 201 | t.Parallel() |
| 202 | |
| 203 | act := CloseStatus(tc.in) |
| 204 | assert.Equal(t, "close status", tc.exp, act) |
| 205 | }) |
| 206 | } |
| 207 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…