anchor.diff:      Actual = size(Rest) + 1, % to account for the consumed \n
       case Length =:= Actual of
           true ->
  -            {Length, Rest};
  +            parse_body({Length, Rest});
           false ->
               {bad_length, {Length, Rest}}
       end;
  
positive.code:       },
  
        {"parse_packet content length mismatch",
         fun() ->
                 BadLength = [{<<"1|11\na_label:1|m">>,
                               {11, <<"a_label:1|m">>}},
  
negative.code:                           
                           ],
  
                 [ ?_assertEqual({bad_length, {L, R}}, parse_packet(P))
                   || {P, {L, R}} <- Packets ]
         end
        },
  
        {"parse_line valid metric tests",
         generator,
         fun() ->
                 Tests = [{<<"label:1|m">>, #shp_metric{key = <<"label">>,
                                                        value = 1,
                                                        type = 'm'}},
  
                          {<<"label:123|h">>, #shp_metric{key = <<"label">>,
                                                          value = 123,
                                                          type = 'h'}},
  
                          {<<"x:-123|g">>, #shp_metric{key = <<"x">>,
                                                          value = -123,
                                                          type = 'g'}},
  
  
                          {<<"x:123|h">>, #shp_metric{key = <<"x">>,
                                                          value = 123,
                                                          type = 'h'}},
  
                          % sample rate
                          {<<"x:123|h|@0.43">>, #shp_metric{key = <<"x">>,
                                                            value = 123,
                                                            type = 'h',
                                                            sample_rate = 0.43}}
                          
                         ],
                 [ ?_assertEqual(Expect, parse_line(In)) ||
                    {In, Expect} <- Tests ]
         end
        },
  
        {"parse_line invalid metric tests",
         generator,
         fun() ->
                 % TODO
                 []
         end
        }
       ]}.
  