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 B79F5185ED for ; Wed, 2 Dec 2015 23:02:07 +0000 (UTC) Received: (qmail 43999 invoked by uid 500); 2 Dec 2015 23:02:05 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 43209 invoked by uid 500); 2 Dec 2015 23:02:04 -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 41023 invoked by uid 99); 2 Dec 2015 23:02:02 -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; Wed, 02 Dec 2015 23:02:02 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1093BE67DC; Wed, 2 Dec 2015 23:02:02 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kxepal@apache.org To: commits@couchdb.apache.org Date: Wed, 02 Dec 2015 23:02:48 -0000 Message-Id: In-Reply-To: <420563d655c74cdd8457841366bdc54d@git.apache.org> References: <420563d655c74cdd8457841366bdc54d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [48/50] couchdb commit: updated refs/heads/1.x.x to 921006f Add ?assertNotMatch eunit macro for Authored: Fri Nov 28 07:35:54 2014 +0300 Committer: Alexander Shorin Committed: Thu Dec 3 00:52:11 2015 +0300 ---------------------------------------------------------------------- test/couchdb/include/couch_eunit.hrl.in | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/ac9e22d0/test/couchdb/include/couch_eunit.hrl.in ---------------------------------------------------------------------- diff --git a/test/couchdb/include/couch_eunit.hrl.in b/test/couchdb/include/couch_eunit.hrl.in index ff080e1..063b3db 100644 --- a/test/couchdb/include/couch_eunit.hrl.in +++ b/test/couchdb/include/couch_eunit.hrl.in @@ -42,3 +42,23 @@ {A, B, C} = erlang:now(), lists:flatten(io_lib:format("~p~p~p", [A, B, C])) end). + +%% Borrowed from https://github.com/richcarl/eunit/blob/master/include/eunit.hrl#L200-L219 +%% TODO: get rid of this once R14* is no longer supported +-ifndef(assertNotMatch). +-define(assertNotMatch(Guard, Expr), + begin + ((fun () -> + __V = (Expr), + case __V of + Guard -> erlang:error({assertNotMatch_failed, + [{module, ?MODULE}, + {line, ?LINE}, + {expression, (??Expr)}, + {pattern, (??Guard)}, + {value, __V}]}); + _ -> ok + end + end)()) + end). +-endif.