You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/08/31 15:36:48 UTC

[GitHub] [couchdb] nickva commented on a change in pull request #3094: Fix ordering of page_size based pagination for views

nickva commented on a change in pull request #3094:
URL: https://github.com/apache/couchdb/pull/3094#discussion_r480211937



##########
File path: src/chttpd/test/exunit/pagination_test.exs
##########
@@ -1163,7 +1221,153 @@ defmodule Couch.Test.Pagination do
             assert length(result["rows"]) > ctx.page_size
           end)
         end
+
+        test "can retrieve all pages", ctx do
+          [descending_query, limit_query] =
+            paginate_queries(
+              ctx,
+              url:
+                "/#{ctx.db_name}/_design/#{ctx.ddoc_id}/_view/#{ctx.view_name}/queries",
+              query: %{page_size: ctx.page_size, descending: ctx.descending},
+              body: :jiffy.encode(ctx.queries)
+            )
+
+          results = List.flatten(descending_query)
+          assert ctx.n_docs == length(results)
+          expected_key_order = :descending
+          expected_ids_order = :ascending
+          assert expected_key_order == ordering?(results, "key"),
+            "expecing keys in #{expected_key_order} order, got: #{inspect field(results, "key")}"

Review comment:
       expecing -> expecting




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org