From 02cb712e18ee5647517fc38b6aa0c188af090894 Mon Sep 17 00:00:00 2001 From: Paul Joseph Davis Date: Wed, 8 Jul 2009 01:33:00 +0000 Subject: Fixes COUCHDB-389 Provide an offset calculation for all view responses. Thanks Brad Anderson. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@792013 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/test/view_offsets.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'share/www/script/test') diff --git a/share/www/script/test/view_offsets.js b/share/www/script/test/view_offsets.js index 31dee8e9..9bbce759 100644 --- a/share/www/script/test/view_offsets.js +++ b/share/www/script/test/view_offsets.js @@ -88,12 +88,19 @@ couchTests.view_offsets = function(debug) { ]; db.bulkSave(docs); - var res = db.view("test/offset", { + var res1 = db.view("test/offset", { startkey: ["b",4], startkey_docid: "b4", endkey: ["b"], limit: 2, descending: true, skip: 1 }) - return res.offset == 4; + var res2 = db.view("test/offset", {startkey: ["c", 3]}); + var res3 = db.view("test/offset", { + startkey: ["b", 6], + endkey: ["b", 7] + }); + + return res1.offset == 4 && res2.offset == docs.length && res3.offset == 8; + }; for(var i = 0; i < 15; i++) T(runTest()); -- cgit v1.2.3