anchor.diff:  -module(ns_bucket).
   
   -include("ns_common.hrl").
  +-include_lib("eunit/include/eunit.hrl").
   
   %% API
   -export([config/1,
  
positive.code: %%%===================================================================
  %%% API
  %%%===================================================================
  
  
  config(Bucket) ->
      {ok, CurrentConfig} = get_bucket(Bucket),
  
negative.code:                    NewBuckets = lists:keyreplace(Bucket, 1, Buckets, {Bucket, NewConfig}),
                     lists:keyreplace(configs, 1, List, {configs, NewBuckets})
             end).
  
  
  %%
  %% Internal functions
  %%
  
  %%
  %% Tests
  %%
  
  min_live_copies_test() ->
      ?assertEqual(min_live_copies([node1], []), undefined),
      ?assertEqual(min_live_copies([node1], [{map, undefined}]), undefined),
      Map1 = [[node1, node2], [node2, node1]],
      ?assertEqual(2, min_live_copies([node1, node2], [{map, Map1}])),
      ?assertEqual(1, min_live_copies([node1], [{map, Map1}])),
      ?assertEqual(0, min_live_copies([node3], [{map, Map1}])),
      Map2 = [[undefined, node2], [node2, node1]],
      ?assertEqual(1, min_live_copies([node1, node2], [{map, Map2}])),
      ?assertEqual(0, min_live_copies([node1, node3], [{map, Map2}])).
  