summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/www/script/test/view_collation.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/share/www/script/test/view_collation.js b/share/www/script/test/view_collation.js
index bcb63404..f59204c7 100644
--- a/share/www/script/test/view_collation.js
+++ b/share/www/script/test/view_collation.js
@@ -85,4 +85,28 @@ couchTests.view_collation = function(debug) {
rows = db.query(queryFun, null, queryOptions).rows;
T(rows.length == 1 && equals(rows[0].key, values[i]));
}
+
+ // test inclusive_end=true (the default)
+ // the inclusive_end=true functionality is limited to endkey currently
+ // if you need inclusive_start=false for startkey, please do implement. ;)
+ var rows = db.query(queryFun, null, {endkey : "b", inclusive_end:true}).rows;
+ T(rows[rows.length-1].key == "b")
+ // descending=true
+ var rows = db.query(queryFun, null, {endkey : "b",
+ descending:true, inclusive_end:true}).rows;
+ T(rows[rows.length-1].key == "b")
+
+ // test inclusive_end=false
+ var rows = db.query(queryFun, null, {endkey : "b", inclusive_end:false}).rows;
+ T(rows[rows.length-1].key == "aa")
+ // descending=true
+ var rows = db.query(queryFun, null, {endkey : "b",
+ descending:true, inclusive_end:false}).rows;
+ T(rows[rows.length-1].key == "B")
+
+ // inclusive_end=false overrides endkey_docid
+ var rows = db.query(queryFun, null, {
+ endkey : "b", endkey_docid: "b",
+ inclusive_end:false}).rows;
+ T(rows[rows.length-1].key == "aa")
};