anchor.diff:  
           // Upload all but the last chunk.
           // The final send will be done in the [onDone] handler.
  -        if (chunkStack.length > 1) {
  +        bool hasPartialChunk = chunkStack.hasPartialChunk;
  +        if (chunkStack.length > 1 ||
  +            (chunkStack.length == 1 && hasPartialChunk)) {
             // Pause the input stream.
             subscription.pause();
   
             // Upload all chunks except the last one.
  -          var fullChunks = chunkStack.removeSublist(0, chunkStack.length - 1);
  +          var fullChunks;
  +          if (hasPartialChunk) {
  +            fullChunks = chunkStack.removeSublist(0, chunkStack.length);
  +          } else {
  +            fullChunks = chunkStack.removeSublist(0, chunkStack.length - 1);
  +          }
             Future.forEach(fullChunks,
                            (c) => _uploadChunkDrained(uploadUri, c)).then((_) {
               // All chunks uploaded, we can continue consuming data.
  
positive.code: import 'package:$packageName/src/common_internal.dart';
  import 'package:http/http.dart' as http;
  import 'package:unittest/unittest.dart';
  """ + r"""
  class HttpServerMock extends http.BaseClient {
    Function _callback;
  
negative.code:                      1024*1024], false);
            });
  
            test('length-big-block-parts-non-divisible', () {
              runTest(1, 1024 * 1024 + 1,
                      [1,
                       256*1024-1,
                       256*1024,
                       256*1024+1,
                       1024*1024-1,
                       1024*1024,
                       1024*1024+1], false);
            });
  
            test('stream-small-block', () {
              runTest(1, 10, [10], true);
            });
  