couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [50/50] [abbrv] couch commit: updated refs/heads/master to 55e98c4
Date Fri, 05 Sep 2014 21:11:17 GMT
Temporarily add ?assertNotMatch eunit macro for R14*


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

Branch: refs/heads/master
Commit: 55e98c44c0b45886d9b75556d96aa9dde4dfe51c
Parents: 2b2f129
Author: Russell Branca <chewbranca@apache.org>
Authored: Thu Sep 4 20:03:16 2014 -0700
Committer: Russell Branca <chewbranca@apache.org>
Committed: Thu Sep 4 20:03:16 2014 -0700

----------------------------------------------------------------------
 include/couch_eunit.hrl | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/55e98c44/include/couch_eunit.hrl
----------------------------------------------------------------------
diff --git a/include/couch_eunit.hrl b/include/couch_eunit.hrl
index 20a2033..6398cdd 100644
--- a/include/couch_eunit.hrl
+++ b/include/couch_eunit.hrl
@@ -54,3 +54,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.


Mime
View raw message