summaryrefslogtreecommitdiff
path: root/rel/overlay/share/www/script
diff options
context:
space:
mode:
authorRobert Newson <rnewson@apache.org>2011-01-28 17:49:37 +0000
committerAdam Kocoloski <adam@cloudant.com>2011-01-28 16:14:16 -0500
commitfb799cc8e99cf2be5aad7fa294ddd69c7141620d (patch)
treef52fddf70aa527f5f123c63bf3cf2e06a8785a28 /rel/overlay/share/www/script
parentff9036784e5f3f722f71a536c50b37723595add1 (diff)
COUCHDB-1047 - support inclusive_end with reduce calls
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@1064800 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'rel/overlay/share/www/script')
-rw-r--r--rel/overlay/share/www/script/test/reduce.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/rel/overlay/share/www/script/test/reduce.js b/rel/overlay/share/www/script/test/reduce.js
index 979a0292..16c7a7bf 100644
--- a/rel/overlay/share/www/script/test/reduce.js
+++ b/rel/overlay/share/www/script/test/reduce.js
@@ -100,6 +100,21 @@ couchTests.reduce = function(debug) {
T(equals(results.rows[4], {key:["d","a"],value:10*i}));
T(equals(results.rows[5], {key:["d","b"],value:10*i}));
T(equals(results.rows[6], {key:["d","c"],value:10*i}));
+
+ // endkey test with inclusive_end=true
+ var results = db.query(map, reduce, {group_level:2,endkey:["d"],inclusive_end:true});
+ T(equals(results.rows[0], {key:["a"],value:20*i}));
+ T(equals(results.rows[1], {key:["a","b"],value:40*i}));
+ T(equals(results.rows[2], {key:["a","c"],value:10*i}));
+ T(equals(results.rows[3], {key:["d"],value:10*i}));
+ TEquals(4, results.rows.length);
+
+ // endkey test with inclusive_end=false
+ var results = db.query(map, reduce, {group_level:2,endkey:["d"],inclusive_end:false});
+ T(equals(results.rows[0], {key:["a"],value:20*i}));
+ T(equals(results.rows[1], {key:["a","b"],value:40*i}));
+ T(equals(results.rows[2], {key:["a","c"],value:10*i}));
+ TEquals(3, results.rows.length);
}
// now test out more complex reductions that need to use the combine option.