Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Test and fix for a printable yet improper list

  • Loading branch information...
commit ed7e2aac351c643bd025131588142e61e6a92e39 1 parent 1531170
@Vagabond Vagabond authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/lager_trunc_io.erl
View
4 src/lager_trunc_io.erl
@@ -392,6 +392,9 @@ alist([H|T], Max, #print_options{force_strings=true} = Options) when is_integer(
alist(_, _, #print_options{force_strings=true}) ->
erlang:error(badarg);
alist([H|_L], _Max, _Options) ->
+ throw({unprintable, H});
+alist(H, _Max, _Options) ->
+ %% improper list
throw({unprintable, H}).
%% is the first character in the atom alphabetic & lowercase?
@@ -622,6 +625,7 @@ list_printing_test() ->
%%improper list
?assertEqual("[1,2,3|4]", lists:flatten(format("~P", [[1|[2|[3|4]]], 5], 50))),
?assertEqual("[1|1]", lists:flatten(format("~P", [[1|1], 5], 50))),
+ ?assertEqual("[9|9]", lists:flatten(format("~p", [[9|9]], 50))),
ok.
tuple_printing_test() ->
Please sign in to comment.
Something went wrong with that request. Please try again.