You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by be...@apache.org on 2014/02/13 17:43:07 UTC

[05/50] lager commit: updated refs/heads/import-master to da4419e

simple test for pretty print of nested records.


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

Branch: refs/heads/import-master
Commit: 773e4439be0314adf2acf559b426fb7e9a7b85e7
Parents: 2965c23
Author: Maxim Minin <maxim@mir-desktop.(none)>
Authored: Mon Sep 2 19:05:30 2013 +0200
Committer: Maxim Minin <maxim@mir-desktop.(none)>
Committed: Mon Sep 2 19:05:30 2013 +0200

----------------------------------------------------------------------
 test/pr_nested_record_test.erl | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-lager/blob/773e4439/test/pr_nested_record_test.erl
----------------------------------------------------------------------
diff --git a/test/pr_nested_record_test.erl b/test/pr_nested_record_test.erl
new file mode 100644
index 0000000..ee19ef7
--- /dev/null
+++ b/test/pr_nested_record_test.erl
@@ -0,0 +1,21 @@
+-module(pr_nested_record_test).
+
+-compile([{parse_transform, lager_transform}]).
+
+-record(a, {field1, field2}).
+-record(b, {field1, field2}).
+
+
+-ifdef(TEST).
+-include_lib("eunit/include/eunit.hrl").
+-endif.
+
+nested_record_test() ->
+    A = #a{field1 = x, field2 = y}, 
+    B = #b{field1 = A, field2 = z},
+    Pr_B = lager:pr(B, ?MODULE),
+    ?assertEqual({'$lager_record', b,
+                    [{field1, {'$lager_record', a,
+                                    [{field1, x},{field2, y}]}},
+                     {field2, z}]}, 
+                   Pr_B).