summaryrefslogtreecommitdiff
path: root/share/www/script/test/view_collation_raw.js
diff options
context:
space:
mode:
authorPaul Joseph Davis <davisp@apache.org>2011-08-15 03:57:48 +0000
committerPaul Joseph Davis <davisp@apache.org>2011-08-15 03:57:48 +0000
commit0dc0f8b41f627876f65183ea1d99c68b16abeae0 (patch)
treecc8b672ac2c4f3b7a38c05c3c0de0be023369b15 /share/www/script/test/view_collation_raw.js
parent2eb62337efc1171d1ea1e4392f8cacf0dabc1ab0 (diff)
Fix empty range check for raw collation.
The check for empty ranges was not taking into account the view option for raw collation. This fixes that by passing the couch_btree:less/2 function into the check. Patch by: Jason Smith Back port of: 1156506, 1156507, 1156509, 1156509, 1156610 git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1157706 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/test/view_collation_raw.js')
-rw-r--r--share/www/script/test/view_collation_raw.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/share/www/script/test/view_collation_raw.js b/share/www/script/test/view_collation_raw.js
index 31624cdb..779f7eb8 100644
--- a/share/www/script/test/view_collation_raw.js
+++ b/share/www/script/test/view_collation_raw.js
@@ -76,12 +76,19 @@ couchTests.view_collation_raw = function(debug) {
}
}
T(db.save(designDoc).ok);
+
+ // Confirm that everything collates correctly.
var rows = db.view("test/test").rows;
for (i=0; i<values.length; i++) {
T(equals(rows[i].key, values[i]));
}
- // everything has collated correctly. Now to check the descending output
+ // Confirm that couch allows raw semantics in key ranges.
+ rows = db.view("test/test", {startkey:"Z", endkey:"a"}).rows;
+ TEquals(1, rows.length);
+ TEquals("a", rows[0].key);
+
+ // Check the descending output.
rows = db.view("test/test", {descending: true}).rows;
for (i=0; i<values.length; i++) {
T(equals(rows[i].key, values[values.length - 1 -i]));