You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2020/06/05 21:38:20 UTC

[couchdb] 05/05: Test bumping db versions multiple times

This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch prototype/fdb-layer-db-version-as-vstamps
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 0bda0eda9d1d735124175f24c1491baf445069bd
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Fri Jun 5 15:55:57 2020 -0500

    Test bumping db versions multiple times
---
 src/fabric/test/fabric2_doc_crud_tests.erl | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/fabric/test/fabric2_doc_crud_tests.erl b/src/fabric/test/fabric2_doc_crud_tests.erl
index ce3757d..0e3dfb3 100644
--- a/src/fabric/test/fabric2_doc_crud_tests.erl
+++ b/src/fabric/test/fabric2_doc_crud_tests.erl
@@ -31,6 +31,7 @@ doc_crud_test_() ->
                 ?TDEF(open_missing_doc),
                 ?TDEF(create_new_doc),
                 ?TDEF(create_ddoc_basic),
+                ?TDEF(create_ddoc_multi),
                 ?TDEF(create_ddoc_requires_admin),
                 ?TDEF(create_ddoc_requires_validation),
                 ?TDEF(create_ddoc_requires_compilation),
@@ -111,6 +112,22 @@ create_ddoc_basic({Db, _}) ->
     ?assertEqual({ok, NewDoc}, fabric2_db:open_doc(Db, Doc#doc.id)).
 
 
+create_ddoc_multi({Db, _}) ->
+    UUID1 = fabric2_util:uuid(),
+    Doc1 = #doc{
+        id = <<"_design/", UUID1/binary>>,
+        body = {[{<<"foo">>, <<"bar">>}]}
+    },
+    UUID2 = fabric2_util:uuid(),
+    Doc2 = #doc{
+        id = <<"_design/", UUID2/binary>>,
+        body = {[{<<"foo">>, <<"bar">>}]}
+    },
+    {ok, _} = fabric2_db:update_docs(Db, [Doc1, Doc2]),
+    ?assertMatch({ok, #doc{}}, fabric2_db:open_doc(Db, Doc1#doc.id)),
+    ?assertMatch({ok, #doc{}}, fabric2_db:open_doc(Db, Doc2#doc.id)).
+
+
 can_create_a_partitioned_ddoc({Db, _}) ->
     UUID = fabric2_util:uuid(),
     DDocId = <<"_design/", UUID/binary>>,