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/03/24 23:17:28 UTC

[GitHub] [couchdb] jjrodrig commented on a change in pull request #2703: Port view_pagination integration test to elixir test suite

jjrodrig commented on a change in pull request #2703: Port view_pagination integration test to elixir test suite
URL: https://github.com/apache/couchdb/pull/2703#discussion_r397518759
 
 

 ##########
 File path: test/elixir/test/view_pagination_test.exs
 ##########
 @@ -0,0 +1,189 @@
+defmodule ViewPaginationTest do
+  use CouchTestCase
+
+  @moduletag :view_pagination
+
+  @moduledoc """
+  Integration tests for pagination.
+  This is a port of the view_pagination.js test suite.
+  """
+
+  @tag :with_db
+  test "basic view pagination", context do
+    db_name = context[:db_name]
+
+    docs = make_docs(0..99)
+    bulk_save(db_name, docs)
+
+    query_function = "function(doc) { emit(doc.integer, null); }"
+
+    0..99
+    |> Enum.filter(fn number -> rem(number, 10) === 0 end)
 
 Review comment:
   This stepped range calculation looks a little bit tricky but i don't seen a more direct way to do it.

----------------------------------------------------------------
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


With regards,
Apache Git Services