Permalink
Browse files

Added more test cases

  • Loading branch information...
1 parent f52558b commit 3a7b2358665f220d8d0064fcf6f5d7bb6113e03c @saleyn committed Oct 4, 2012
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/lager_util.erl
View
13 src/lager_util.erl
@@ -477,19 +477,24 @@ is_loggable_test_() ->
format_time_test_() ->
[
- ?_assertEqual("2012-10-04 11:16:23.892",
+ ?_assertEqual("2012-10-04 11:16:23.002",
begin
- {D, T} = format_time({{2012,10,04},{11,16,23,892}}),
+ {D, T} = format_time({{2012,10,04},{11,16,23,2}}),
+ lists:flatten([D,$ ,T])
+ end),
+ ?_assertEqual("2012-10-04 11:16:23.999",
+ begin
+ {D, T} = format_time({{2012,10,04},{11,16,23,999}}),
lists:flatten([D,$ ,T])
end),
?_assertEqual("2012-10-04 11:16:23",
begin
{D, T} = format_time({{2012,10,04},{11,16,23}}),
lists:flatten([D,$ ,T])
end),
- ?_assertEqual("2012-10-04 11:16:23.892 UTC",
+ ?_assertEqual("2012-10-04 00:16:23.092 UTC",
begin
- {D, T} = format_time({utc, {{2012,10,04},{11,16,23,892}}}),
+ {D, T} = format_time({utc, {{2012,10,04},{0,16,23,92}}}),
lists:flatten([D,$ ,T])
end),
?_assertEqual("2012-10-04 11:16:23 UTC",

0 comments on commit 3a7b235

Please sign in to comment.