couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject chttpd commit: updated refs/heads/master to ee7785b
Date Tue, 25 Aug 2015 08:08:22 GMT
Repository: couchdb-chttpd
Updated Branches:
  refs/heads/master 4de16f8f5 -> ee7785b33


Fix test after sequence format change

Caused by
https://git-wip-us.apache.org/repos/asf?p=couchdb-fabric.git;h=42a67d0a0


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/ee7785b3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/ee7785b3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/ee7785b3

Branch: refs/heads/master
Commit: ee7785b330fcf8e83557f10d3e4dae5486b3fd04
Parents: 4de16f8
Author: Alexander Shorin <kxepal@apache.org>
Authored: Tue Aug 25 11:07:54 2015 +0300
Committer: Alexander Shorin <kxepal@apache.org>
Committed: Tue Aug 25 11:07:54 2015 +0300

----------------------------------------------------------------------
 test/chttpd_db_test.erl | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/ee7785b3/test/chttpd_db_test.erl
----------------------------------------------------------------------
diff --git a/test/chttpd_db_test.erl b/test/chttpd_db_test.erl
index 9890625..95bbd93 100644
--- a/test/chttpd_db_test.erl
+++ b/test/chttpd_db_test.erl
@@ -73,15 +73,19 @@ should_return_ok_true_on_bulk_update(Url) ->
 
 
 should_accept_live_as_an_alias_for_continuous(Url) ->
-    {ok, _, _, ResultBody} = test_request:get(Url ++ "/_changes?feed=live&timeout=1"),
-    {ResultJson} = ?JSON_DECODE(ResultBody),
-    [Last_Seq, _] = couch_util:get_value(<<"last_seq">>, ResultJson, undefined),
-    {ok, _, _, _} = create_doc(Url, "testdoc2"),
+    ?_test(begin
+        {ok, _, _, ResultBody} = test_request:get(Url ++ "/_changes?feed=live&timeout=1"),
+        {ResultJson} = ?JSON_DECODE(ResultBody),
+        <<LastSeqNum0:1/binary, "-", _/binary>> = couch_util:get_value(
+            <<"last_seq">>, ResultJson, undefined),
+        LastSeqNum = binary_to_integer(LastSeqNum0),
 
-    ?_assertEqual(Last_Seq + 1,
-        begin
-            {ok, _, _, ResultBody2} = test_request:get(Url ++ "/_changes?feed=live&timeout=1"),
-            [_, CleanedResult] = binary:split(ResultBody2, <<"\n">>),
-            {[{_, [Seq, _]}, _]} = ?JSON_DECODE(CleanedResult),
-            Seq
-        end).
+        {ok, _, _, _} = create_doc(Url, "testdoc2"),
+        {ok, _, _, ResultBody2} = test_request:get(Url ++ "/_changes?feed=live&timeout=1"),
+        [_, CleanedResult] = binary:split(ResultBody2, <<"\n">>),
+        {[{_, Seq}, _]} = ?JSON_DECODE(CleanedResult),
+        <<SeqNum0:1/binary, "-", _/binary>> = Seq,
+        SeqNum = binary_to_integer(SeqNum0),
+
+        ?assertEqual(LastSeqNum + 1, SeqNum)
+    end).


Mime
View raw message