rewrite from lager
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

22 lignes
619 B

il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
  1. -module(compress_pr_record_test).
  2. -compile([{parse_transform, lager_transform}]).
  3. -record(a, {field1 :: term(),
  4. field2 :: term(),
  5. foo :: term(),
  6. bar :: term(),
  7. baz :: term(),
  8. zyu :: term(),
  9. zix :: term()}).
  10. -ifdef(TEST).
  11. -include_lib("eunit/include/eunit.hrl").
  12. -endif.
  13. nested_record_test() ->
  14. A = #a{field1 = "Notice me senpai"},
  15. Pr_A = eRum:pr(A, ?MODULE),
  16. Pr_A_Comp = eRum:pr(A, ?MODULE, [compress]),
  17. ?assertMatch({'$lager_record', a, [{field1, "Notice me senpai"}, {field2, undefined} | _]}, Pr_A),
  18. ?assertEqual({'$lager_record', a, [{field1, "Notice me senpai"}]}, Pr_A_Comp).