anchor.diff:  %% ---------------------------------------------------------------------------
   %% negative testing common post-conditions
   
  -http_validate (#state{auth=userlist},{C,_,_},{user,pass}) ->
  -    C < 300;
  -http_validate (#state{auth=userlist},{C,_,_},_) ->
  -    C >= 300;
  -http_validate (#state{auth=none},{C,_,_},_) ->
  -    C < 300.
  +http_validate (#state{auth=userlist},{Code,_,_},{user,pass}) ->
  +    Code < 300;
  +http_validate (#state{auth=userlist},{Code,_,_},_) ->
  +    Code >= 300;
  +http_validate (#state{auth=none},{Code,_,_},_) ->
  +    Code < 300.
  +
  +
  +cluster_validate (_State,{Code,"",_Url}) ->
  +    not (Code < 300);
  +cluster_validate (_State,{_Code,Body,_Url}) ->
  +    [{struct,Node}]=mochijson2:decode(Body),
  +    {_,Name}=lists:keyfind(<<"name">>,1,Node),
  +    {_,Me}=lists:keyfind(<<"me">>,1,Node),
  +    {_,Reachable}=lists:keyfind(<<"reachable">>,1,Node),
  +    binary_to_atom(Name,utf8) == node() andalso Me andalso Reachable.
  +
  +
  +filter_validate (_State,{Code,"",_Url},_Filter) ->
  +    not (Code < 300);
  +filter_validate (#state{ring_size=Size},{_Code,Body,_Url},Filter) ->
  +    {struct,Json}=mochijson2:decode(Body),
  +    {_,Pages}=lists:keyfind(<<"pages">>,1,Json),
  +    {_,Page}=lists:keyfind(<<"page">>,1,Json),
  +    {_,Contents}=lists:keyfind(<<"contents">>,1,Json),
  +    filter_validate_n(Size,Pages,Page,Contents,Filter) andalso
  +        %% TODO: more validation here
  +        true.
  +
  +
  +filter_validate_n (Size,Pages,_Page,Contents,Filter) ->
  +    ContentSize=erlang:length(Contents),
  +    N=case lists:keyfind(n,1,Filter) of
  +          false -> Size div Pages;
  +          {_,X} -> X
  +      end,
  +    %% less than is okay for now, we might have returned the last page
  +    ContentSize =< max(N,16).
   
   
   %% ---------------------------------------------------------------------------
  
positive.code:            ?PARTITION_LIST,
             ?LET(User,g_userpass(),
                  oneof([?HTTP_CLUSTER_LIST(User),
                         ?LET(Filter,g_filter(),
                              ?HTTP_PARTITION_LIST(User,Filter))
                        ]))
            ]).
  
negative.code: precondition (_State,_Gen) ->
      true.
  
  postcondition (State,{call,_,http_cluster_list,[User]},Res) ->
      http_validate(State,Res,User) andalso cluster_validate(State,Res);
  postcondition (State,{call,_,http_partition_list,[User,Filter]},Res) ->
      http_validate(State,Res,User) andalso filter_validate(State,Res,Filter);
  postcondition (_State,_Gen,_Res) ->
      true.
  
  