Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6A18618A0A for ; Tue, 30 Jun 2015 15:39:57 +0000 (UTC) Received: (qmail 6886 invoked by uid 500); 30 Jun 2015 15:39:48 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 6731 invoked by uid 500); 30 Jun 2015 15:39:47 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 6685 invoked by uid 99); 30 Jun 2015 15:39:47 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Jun 2015 15:39:47 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B6558E1091; Tue, 30 Jun 2015 15:39:47 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kocolosk@apache.org To: commits@couchdb.apache.org Date: Tue, 30 Jun 2015 15:39:48 -0000 Message-Id: <2d096822e38b4e35bc0e2185ba8b9da9@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/5] couch-mrview commit: updated refs/heads/master to 19737b7 Use the ?assertEquiv macro for better reporting Also dynamically compute the value for the `total` field to allow us to add additional test data over time. Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/commit/8e8420b8 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/tree/8e8420b8 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/diff/8e8420b8 Branch: refs/heads/master Commit: 8e8420b8873b5b79b07a3076923539a8f5532d14 Parents: 1dc8d52 Author: Adam Kocoloski Authored: Mon Jun 29 16:33:53 2015 -0400 Committer: Adam Kocoloski Committed: Mon Jun 29 21:43:48 2015 -0400 ---------------------------------------------------------------------- test/couch_mrview_collation_tests.erl | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/8e8420b8/test/couch_mrview_collation_tests.erl ---------------------------------------------------------------------- diff --git a/test/couch_mrview_collation_tests.erl b/test/couch_mrview_collation_tests.erl index ccfe5ea..df06ad6 100644 --- a/test/couch_mrview_collation_tests.erl +++ b/test/couch_mrview_collation_tests.erl @@ -87,17 +87,13 @@ collation_test_() -> should_collate_fwd(Db) -> {ok, Results} = run_query(Db, []), - Expect = [{meta, [{total, 26}, {offset, 0}]}] ++ rows(), - %% cannot use _assertEqual since mrview converts - %% value 3.0 to 3 making assertion fail - ?_assert(Expect == Results). + Expect = [{meta, [{total, length(?VALUES)}, {offset, 0}]}] ++ rows(), + ?_assertEquiv(Expect, Results). should_collate_rev(Db) -> {ok, Results} = run_query(Db, [{direction, rev}]), - Expect = [{meta, [{total, 26}, {offset, 0}]}] ++ lists:reverse(rows()), - %% cannot use _assertEqual since mrview converts - %% value 3.0 to 3 making assertion fail - ?_assert(Expect == Results). + Expect = [{meta, [{total, length(?VALUES)}, {offset, 0}]}] ++ lists:reverse(rows()), + ?_assertEquiv(Expect, Results). should_collate_range(Db) -> ?_assertNot( @@ -106,7 +102,7 @@ should_collate_range(Db) -> {ok, Results} = run_query(Db, [{start_key, V}, {end_key, V}]), Id = list_to_binary(integer_to_list(Count)), Expect = [ - {meta, [{total, 26}, {offset, Count}]}, + {meta, [{total, length(?VALUES)}, {offset, Count}]}, {row, [{id, Id}, {key, V}, {value, 0}]} ], case Results == Expect of