func TestUploadOrderMultiBufferedReaderEOF(t *testing.T) {
	s, ops, args := loggingSvc(emptyList)
	mgr := s3manager.NewUploaderWithClient(s)
	_, err := mgr.Upload(&s3manager.UploadInput{
		Bucket: aws.String("Bucket"),
		Key:    aws.String("Key"),
		Body:   &sizedReader{size: 1024 * 1024 * 10, err: io.EOF},
	})

	if err != nil {
		t.Errorf("Expected no error but received %v", err)
	}

	if e, a := []string{"CreateMultipartUpload", "UploadPart", "UploadPart", "CompleteMultipartUpload"}, *ops; !reflect.DeepEqual(e, a) {
		t.Errorf("Expected %v, but receievd %v", e, a)
	}

	// Part lengths
	parts := []int{
		buflen(val((*args)[1], "Body")),
		buflen(val((*args)[2], "Body")),
	}
	sort.Ints(parts)

	if e, a := []int{1024 * 1024 * 5, 1024 * 1024 * 5}, parts; !reflect.DeepEqual(e, a) {
		t.Errorf("Expected %v, but receievd %v", e, a)
	}
}
// TestUploadOrderMultiBufferedReaderEOF tests the edge case where the
// file size is the same as part size.
TestUploadOrderMultiBufferedReaderEOF tests the edge case where the
file size is the same as part size.
// TestUploadOrderMultiBufferedReaderEOF tests the edge case where the // file size is the same as part size .
func TestUploadOrderMultiBufferedReaderEOF(t *testing.T) {
	s, ops, args := loggingSvc(emptyList)
	mgr := s3manager.NewUploaderWithClient(s)
	_, err := mgr.Upload(&s3manager.UploadInput{
		Bucket: aws.String("Bucket"),
		Key:    aws.String("Key"),
		Body:   &sizedReader{size: 1024 * 1024 * 10, err: io.EOF},
	})
	if err != nil {
		t.Errorf("Expected no error but received %v", err)
	}
	if e, a := []string{"CreateMultipartUpload", "UploadPart", "UploadPart", "CompleteMultipartUpload"}, *ops; !reflect.DeepEqual(e, a) {
		t.Errorf("Expected %v, but receievd %v", e, a)
	}
	parts := []int{
		buflen(val((*args)[1], "Body")),
		buflen(val((*args)[2], "Body")),
	}
	sort.Ints(parts)
	if e, a := []int{1024 * 1024 * 5, 1024 * 1024 * 5}, parts; !reflect.DeepEqual(e, a) {
		t.Errorf("Expected %v, but receievd %v", e, a)
	}
}
func TestUploadOrderMultiBufferedReaderEOF ( t * testing . T ) { s , ops , args := loggingSvc ( emptyList ) mgr := s3manager . NewUploaderWithClient ( s ) _ , err := mgr . Upload ( & s3manager . UploadInput { Bucket : aws . String ( " " ) , Key : aws . String ( " " ) , Body : & sizedReader { size : 1024 * 1024 * 10 , err : io . EOF } , } ) if err != nil { t . Errorf ( " " , err ) } if e , a := [ ] string { " " , " " , " " , " " } , * ops ; ! reflect . DeepEqual ( e , a ) { t . Errorf ( " " , e , a ) } parts := [ ] int { buflen ( val ( ( * args ) [ 1 ] , " " ) ) , buflen ( val ( ( * args ) [ 2 ] , " " ) ) , } sort . Ints ( parts ) if e , a := [ ] int { 1024 * 1024 * 5 , 1024 * 1024 * 5 } , parts ; ! reflect . DeepEqual ( e , a ) { t . Errorf ( " " , e , a ) } }
TestUploadOrderMultiBufferedReaderEOF tests the edge case where the
file size is the same as part size.
TestUploadOrderMultiBufferedReaderEOF tests the edge case where the file size is the same as part size .
// Part lengths