Commits

Anonymous committed adf91a8

update etap tests to reflect changes in couch_btree, patch by Bob Dionne, closes COUCHDB-503

Comments (0)

Files changed (1)

test/etap/021-btree-reductions.t

             (_) ->
                 false
         end,
-        couch_btree:fold_reduce(Btree2, nil, nil, GroupFun, FoldFun, []),
+        couch_btree:fold_reduce(Btree2, FoldFun, [], [{key_group_fun, GroupFun}]),
         "Reduction works with no specified direction, startkey, or endkey."
     ),
 
             (_) ->
                 false
         end,
-        couch_btree:fold_reduce(Btree2, fwd, nil, nil, GroupFun, FoldFun, []),
+        couch_btree:fold_reduce(Btree2, FoldFun, [], [{key_group_fun, GroupFun}, {dir, fwd}]),
         "Reducing forward works with no startkey or endkey."
     ),
 
             (_) ->
                 false
         end,
-        couch_btree:fold_reduce(Btree2, rev, nil, nil, GroupFun, FoldFun, []),
+        couch_btree:fold_reduce(Btree2, FoldFun, [], [{key_group_fun, GroupFun}, {dir, rev}]),
         "Reducing backwards works with no startkey or endkey."
     ),
 
             (_) ->
                 false
         end,
-        couch_btree:fold_reduce(Btree2, fwd, SK1, EK2, GroupFun, FoldFun, []),
+        couch_btree:fold_reduce(Btree2, FoldFun, [], [{dir, fwd}, {key_group_fun, GroupFun}, {start_key, SK1}, {end_key, EK2}]),
         "Reducing works over the entire range with startkey and endkey set."
     ),
 
             ({ok, [{{"even", _}, 500}]}) -> true;
             (_) -> false
         end,
-        couch_btree:fold_reduce(Btree2, fwd, SK1, EK1, GroupFun, FoldFun, []),
+        couch_btree:fold_reduce(Btree2, FoldFun, [], [{dir, fwd}, {key_group_fun, GroupFun}, {start_key, SK1}, {end_key, EK1}]),
         "Reducing foward over first half works with a startkey and endkey."
     ),
 
             ({ok, [{{"odd", _}, 500}]}) -> true;
             (_) -> false
         end,
-        couch_btree:fold_reduce(Btree2, fwd, SK2, EK2, GroupFun, FoldFun, []),
+        couch_btree:fold_reduce(Btree2, FoldFun, [], [{dir, fwd}, {key_group_fun, GroupFun}, {start_key, SK2}, {end_key, EK2}]),
         "Reducing foward over second half works with second startkey and endkey"
     ),
 
             ({ok, [{{"odd", _}, 500}]}) -> true;
             (_) -> false
         end,
-        couch_btree:fold_reduce(Btree2, rev, EK2, SK2, GroupFun, FoldFun, []),
+        couch_btree:fold_reduce(Btree2, FoldFun, [], [{dir, rev}, {key_group_fun, GroupFun}, {start_key, EK2}, {end_key, SK2}]),
         "Reducing in reverse works after swapping the startkey and endkey."
     ),
 
             (_) ->
                 false
         end,
-        couch_btree:fold_reduce(Btree2, rev, EK2, SK1, GroupFun, FoldFun, []),
+        couch_btree:fold_reduce(Btree2, FoldFun, [], [{dir, rev}, {key_group_fun, GroupFun}, {start_key, EK2}, {end_key, SK1}]),
         "Reducing in reverse results in reversed accumulator."
     ),