Test validates 'ErrUnexpectedEOF' error response.
(t *testing.T)
| 228 | |
| 229 | // Test validates 'ErrUnexpectedEOF' error response. |
| 230 | func TestErrUnexpectedEOF(t *testing.T) { |
| 231 | msg := fmt.Sprintf("Data read ‘%s’ is not equal to the size ‘%s’ of the input Reader.", |
| 232 | strconv.FormatInt(100, 10), strconv.FormatInt(101, 10)) |
| 233 | expectedResult := ErrorResponse{ |
| 234 | StatusCode: http.StatusBadRequest, |
| 235 | Code: UnexpectedEOF, |
| 236 | Message: msg, |
| 237 | BucketName: "minio-bucket", |
| 238 | Key: "Asia/", |
| 239 | } |
| 240 | actualResult := errUnexpectedEOF(100, 101, "minio-bucket", "Asia/") |
| 241 | if !reflect.DeepEqual(expectedResult, actualResult) { |
| 242 | t.Errorf("Expected result to be '%#v', but instead got '%#v'", expectedResult, actualResult) |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | // Test validates 'errInvalidArgument' response. |
| 247 | func TestErrInvalidArgument(t *testing.T) { |
nothing calls this directly
no test coverage detected