diff options
-rw-r--r-- | share/www/script/couch_tests.js | 16 | ||||
-rw-r--r-- | src/couchdb/couch_httpd.erl | 3 |
2 files changed, 19 insertions, 0 deletions
diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js index cf1a4865..5f9cb5ae 100644 --- a/share/www/script/couch_tests.js +++ b/share/www/script/couch_tests.js @@ -423,6 +423,9 @@ var tests = { restartServer(); T(db.open(designDoc._id) == null); T(db.view("test/no_docs") == null); + + + }, view_collation: function(debug) { @@ -602,6 +605,19 @@ var tests = { T(queryResults.rows[j].key == i + 9 - j); } } + + // ignore decending=false. CouchDB should just ignore that. + for (i = 0; i < docs.length; i += 10) { + var queryResults = db.query(queryFun, {startkey:i, startkey_docid:i, + descending:false, count:10}); + T(queryResults.rows.length == 10) + T(queryResults.total_rows == docs.length) + T(queryResults.offset == i) + var j; + for (j = 0; j < 10;j++) { + T(queryResults.rows[j].key == i + j); + } + } }, view_sandboxing: function(debug) { diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl index 52aa1507..11a380e9 100644 --- a/src/couchdb/couch_httpd.erl +++ b/src/couchdb/couch_httpd.erl @@ -599,6 +599,9 @@ parse_view_query(Req) -> _ -> Args %already reversed end; + {"descending", "false"} -> + % ignore + Args; {"skip", Value} -> case (catch list_to_integer(Value)) of Count when is_integer(Count) -> |