anchor.diff:              check_not_found_counts_for_descendant(),
               check_worker_error_skipped(),
               check_not_found_replies_are_removed_when_doc_found(),
  +            check_not_found_returned_when_one_of_docs_not_found(),
               check_not_found_returned_when_doc_not_found()
           ]
       }.
  
positive.code:     lists:sort([Reply || {_, {Reply, _}} <- Dict]).
  
  filter_reply(Replies) ->
      case [{ok, Doc} || {ok, Doc} <- Replies] of
          [] -> Replies;
          Filtered -> Filtered
      end.
  
  -ifdef(TEST).
  -include_lib("eunit/include/eunit.hrl").
  
negative.code:         ?assertEqual(Expect, handle_message(Msg3, w2, S2))
      end).
  
  
  check_not_found_replies_are_removed_when_doc_found() ->
      ?_test(begin
          Replies = replies_to_dict([foo1(), bar1(), fooNF()]),
          Expect = replies_to_dict([foo1(), bar1()]),
          ?assertEqual(Expect, filter_reply(Replies))
      end).
  
  check_not_found_returned_when_one_of_docs_not_found() ->
      ?_test(begin
          Replies = replies_to_dict([foo1(), foo2(), barNF()]),
          Expect = replies_to_dict([foo1(), foo2(), barNF()]),
          ?assertEqual(Expect, filter_reply(Replies))
      end).
  
  check_not_found_returned_when_doc_not_found() ->
      ?_test(begin
          Replies = replies_to_dict([fooNF(), barNF(), bazNF()]),
          Expect = replies_to_dict([fooNF(), barNF(), bazNF()]),
          ?assertEqual(Expect, filter_reply(Replies))
      end).
  
  replies_to_dict(Replies) ->
      [reply_to_element(R) || R <- Replies].
  
  reply_to_element({ok, #doc{revs = Revs}} = Reply) ->
      {_, [Rev | _]} = Revs,
      {{Rev, Revs}, {Reply, 1}};
  reply_to_element(Reply) ->
      {Reply, {Reply, 1}}.
  
  -endif.
  