anchor.diff:        },
   
         {"parse_packet content length mismatch",
  +       generator,
          fun() ->
                  BadLength = [{<<"1|11\na_label:1|m">>,
                                {11, <<"a_label:1|m">>}},
  
positive.code:     parse_packet(Rest, [C|Acc]);
  parse_packet(<<>>, Acc) ->
      {bad_length, {lists:reverse(Acc), <<>>}}.
      
  parse_header(Packet) ->
      [Head|Lines] = binary:split(Packet, <<"\n">>, [global]),
      % verify we are at version 1
      [?SHP_VERSION, Len] = [ ?to_int(X) || X <- binary:split(Head, <<"|">>) ],
      {{?SHP_VERSION, Len}, Lines}.
  
  estatsd_shp_test_() ->
      {foreach,
  
negative.code:              cleanup
       end,
       [
        {"parse_packet valid packet",
         fun() ->
                 Packet = <<"1|12\na_label:1|m">>,
                 ?assertEqual([#shp_metric{key = <<"a_label">>,
                                         value = 1,
                                         type = m,
                                          sample_rate = undefined}],
                              parse_packet(Packet))
         end
        },
  
  