anchor.diff:      ?assertEqual(element(2, Trailer), 
           lhttpc_lib:header_value("x-test-orig-trailer-1", headers(Response2))).
   
  +partial_download_identity() ->
  +    Port = start(gen_tcp, [fun large_response/5]),
  +    URL = url(Port, "/partial_download_identity"),
  +    PartialDownload = [
  +        {window_size, 1},
  +        {receiver, self()}
  +    ],
  +    Options = [{partial_download, PartialDownload}],
  +    {ok, {Status, _, Pid}} =
  +        lhttpc:request(URL, get, [], <<>>, 1000, Options),
  +    Body = read_partial_body(Pid),
  +    ?assertEqual({200, "OK"}, Status),
  +    ?assertEqual(<<?LONG_BODY_PART ?LONG_BODY_PART ?LONG_BODY_PART>>, Body).
  +
  +limited_partial_download_identity() ->
  +    Port = start(gen_tcp, [fun large_response/5]),
  +    URL = url(Port, "/partial_download_identity"),
  +    PartialDownload = [
  +        {window_size, 1},
  +        {receiver, self()},
  +        {part_size, 512} % bytes
  +    ],
  +    Options = [{partial_download, PartialDownload}],
  +    {ok, {Status, _, Pid}} =
  +        lhttpc:request(URL, get, [], <<>>, 1000, Options),
  +    Body = read_partial_body(Pid, 512),
  +    ?assertEqual({200, "OK"}, Status),
  +    ?assertEqual(<<?LONG_BODY_PART ?LONG_BODY_PART ?LONG_BODY_PART>>, Body).
  +
  +partial_download_chunked() ->
  +    Port = start(gen_tcp, [fun large_chunked_response/5]),
  +    URL = url(Port, "/partial_download_identity"),
  +    PartialDownload = [
  +        {window_size, 1},
  +        {receiver, self()}
  +    ],
  +    Options = [{partial_download, PartialDownload}],
  +    {ok, {Status, _, Pid}} =
  +        lhttpc:request(URL, get, [], <<>>, 1000, Options),
  +    Body = read_partial_body(Pid),
  +    ?assertEqual({200, "OK"}, Status),
  +    ?assertEqual(<<?LONG_BODY_PART ?LONG_BODY_PART ?LONG_BODY_PART>>, Body).
  +
   close_connection() ->
       Port = start(gen_tcp, [fun close_connection/5]),
       URL = url(Port, "/close"),
  
positive.code:             ?DEFAULT_STRING
          ]
      ).
  
  chunked_upload(Module, Socket, _, Headers, <<>>) ->
      TransferEncoding = lhttpc_lib:header_value("transfer-encoding", Headers),
  
negative.code: -include_lib("eunit/include/eunit.hrl").
  
  -define(DEFAULT_STRING, "Great success!").
  -define(LONG_BODY_PART,
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
          "This is a relatively long body, that we send to the client... "
      ).
  
  test_no(N, Tests) ->
  	setelement(4, Tests, lists:nth(N, element(4, Tests))).
  