anchor.diff:                     <<"-3">>,
                      <<"1.2.-1">>,
                      <<"1.-2.1">>,
  -                   <<"-1.2.1">>
  +                   <<"-1.2.1">>,
  +                   << ?BAD_POSITIVE_VERSION, ".2.1">>,
  +                   <<"1.",?BAD_POSITIVE_VERSION,".1">>,
  +                   <<"1.2.",?BAD_POSITIVE_VERSION >>
                      %% we store maj, min, pat in pg int field in the db, so we should enforce
                      %% the max value and avoid wrapping.
                     ],
  
positive.code: -include_lib("eunit/include/eunit.hrl").
  -include_lib("ej/include/ej.hrl").
  
  
  basic_cookbook(Name, Version) ->
      basic_cookbook(Name, Version, []).
  
negative.code:                     {<<"1">>, {1, 0, 0}},
                      {<<"1.2">>, {1, 2, 0}},
                      {<<"1.2.3">>, {1, 2, 3}},
                      {<<"1.2.", ?MAX_GOOD_VERSION>>, {1,2, ?MAX_GOOD_VERSION_INT}},
                      {<<"1.", ?MAX_GOOD_VERSION>>, {1, ?MAX_GOOD_VERSION_INT, 0}},
                      {<<?MAX_GOOD_VERSION>>, {?MAX_GOOD_VERSION_INT, 0, 0}},
                      {<<?MAX_GOOD_VERSION, ".0">>, {?MAX_GOOD_VERSION_INT, 0, 0}},
                      {<<"0.",?MAX_GOOD_VERSION,".0">>, {0, ?MAX_GOOD_VERSION_INT, 0}},
                      {<<"0.0.0">>, {0, 0, 0}},
                      {<<"123.456.789">>, {123, 456, 789}}],
      [ ?_assertEqual(Expect, chef_cookbook:parse_version(In)) ||
  