davisp commented on a change in pull request #2638: Prototype/fdb layer couch 
views size tests
URL: https://github.com/apache/couchdb/pull/2638#discussion_r388496956
 
 

 ##########
 File path: src/couch_views/test/couch_views_indexer_test.erl
 ##########
 @@ -388,6 +389,77 @@ multipe_identical_keys_from_same_doc(Db) ->
         ], Out).
 
 
+fewer_multipe_identical_keys_from_same_doc(Db) ->
+    DDoc = create_ddoc(multi_emit_same),
+
+    Doc0 = couch_doc:from_json_obj({[
+        {<<"_id">>, list_to_binary(integer_to_list(0))},
+        {<<"val">>, 1},
+        {<<"extra">>, 3}
+    ]}),
+
+    {ok, _} = fabric2_db:update_doc(Db, DDoc, []),
+    {ok, {Pos, Rev}} = fabric2_db:update_doc(Db, Doc0, []),
+
+    {ok, Out1} = couch_views:query(
+            Db,
+            DDoc,
+            <<"map_fun1">>,
+            fun fold_fun/2,
+            [],
+            #mrargs{}
+        ),
+
+    ?assertEqual([
+            {row, [
+                {id, <<"0">>},
+                {key, 1},
+                {value, 1}
+            ]},
+            {row, [
+                {id, <<"0">>},
+                {key, 1},
+                {value, 2}
+            ]},
+            {row, [
+                {id, <<"0">>},
+                {key, 1},
+                {value, 3}
+            ]}
+        ], Out1),
+
+    Doc1 = couch_doc:from_json_obj({[
+        {<<"_id">>, list_to_binary(integer_to_list(0))},
 
 Review comment:
   Went with `<<"0">>` directly.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to