Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove broken code for stripping square brackets

  • Loading branch information...
commit c8eed3518401a298d783d52bb78204a88c9290de 1 parent 80e5307
Andrew Thompson Vagabond authored
Showing with 5 additions and 7 deletions.
  1. +5 −7 src/lager_trunc_io.erl
12 src/lager_trunc_io.erl
View
@@ -149,7 +149,7 @@ print(Bin, Max, _Options) when is_binary(Bin), Max < 2 ->
{"<<...>>", 7};
print(Binary, Max, Options) when is_binary(Binary) ->
B = binary_to_list(Binary, 1, lists:min([Max, byte_size(Binary)])),
- {L, Len} = case Options#print_options.lists_as_strings orelse
+ {Res, Length} = case Options#print_options.lists_as_strings orelse
Options#print_options.force_strings of
true ->
Depth = Options#print_options.depth,
@@ -198,12 +198,6 @@ print(Binary, Max, Options) when is_binary(Binary) ->
_ ->
list_body(B, Max-4, dec_depth(Options), true)
end,
- {Res, Length} = case L of
- [91, X, 93] ->
- {X, Len-2};
- X ->
- {X, Len}
- end,
case Options#print_options.force_strings of
true ->
{Res, Length};
@@ -611,6 +605,9 @@ binary_printing_test() ->
?assertEqual("<<\"hello\\fworld\">>", lists:flatten(format("~p", [<<"hello\fworld">>], 50))),
?assertEqual("<<\"hello\\vworld\">>", lists:flatten(format("~p", [<<"hello\vworld">>], 50))),
?assertEqual(" hello", lists:flatten(format("~10s", [<<"hello">>], 50))),
+ ?assertEqual("[a]", lists:flatten(format("~s", [<<"[a]">>], 50))),
+ ?assertEqual("[a]", lists:flatten(format("~s", [[<<"[a]">>]], 50))),
+
ok.
bitstring_printing_test() ->
@@ -679,6 +676,7 @@ iolist_printing_test() ->
lists:flatten(format("~s", [[<<"123456789">>, "HellIamaniolist"]], 13))),
?assertEqual("123456789HellIamaniolist",
lists:flatten(format("~s", [[<<"123456789">>, "HellIamaniolist"]], 30))),
+
ok.
tuple_printing_test() ->
Please sign in to comment.
Something went wrong with that request. Please try again.