anchor.diff:      lager:info("Remote code loading complete."),
   
       lager:info("Remotely executing the get minimum test."),
  -    pass = rpc:call(Node, derflow_get_minimum_test, test, []),
  -
  +    Result = rpc:call(Node, derflow_get_minimum_test, test, [[1,2,3,4,5]]),
  +    ?assertEqual(1, Result),
       pass.
   
   -endif.
   
  -test() ->
  -    List = [1,2,3,4,5],
  +test(List) ->
       {ok, S1} = derflow:declare(),
       ?TABLE = ets:new(?TABLE, [set, named_table, public, {write_concurrency, true}]),
       true = ets:insert(?TABLE, {count, 0}),
       derflow:thread(derflow_get_minimum_test, insort, [List, S1]),
  -    {V, _} = derflow:read(S1),
  -    lager:info("Minimum: ~p", [V]),
  -    pass.
  +    {ok, V, _} = derflow:read(S1),
  +    V.
   
   insort(List, S) ->
       case List of
  
positive.code:     [{Id, C}] = ets:lookup(?TABLE, count),
      true = ets:insert(?TABLE, {Id, C+1}),
      ok = derflow:wait_needed(Out),
      case derflowdis:read(In) of
          {ok, {nil, _}} ->
              {ok, Next} = derflow:bind(Out, X),
              derflow:bind(Next, nil);
          {ok, {V, SNext}} ->
              if
                  X < V ->
                      {ok, Next} = derflowdis:bind(Out, X),
                      derflowdis:bind(Next, In);
                  true ->
                      {ok, Next} = derflowdis:bind(Out, V),
                      insert(X, SNext, Next)
              end
      end.
  
negative.code: -module(derflow_get_minimum_test).
  -author("Christopher Meiklejohn <cmeiklejohn@basho.com>").
  
  -export([test/1,
           insort/2,
           insert/3]).
  
  