@@ -149,7 +149,7 @@ print(Bin, Max, _Options) when is_binary(Bin), Max < 2 ->
149149 {" <<...>>" , 7 };
150150print (Binary , Max , Options ) when is_binary (Binary ) ->
151151 B = binary_to_list (Binary , 1 , lists :min ([Max , byte_size (Binary )])),
152- {L , Len } = case Options # print_options .lists_as_strings orelse
152+ {Res , Length } = case Options # print_options .lists_as_strings orelse
153153 Options # print_options .force_strings of
154154 true ->
155155 Depth = Options # print_options .depth ,
@@ -198,12 +198,6 @@ print(Binary, Max, Options) when is_binary(Binary) ->
198198 _ ->
199199 list_body (B , Max - 4 , dec_depth (Options ), true )
200200 end ,
201- {Res , Length } = case L of
202- [91 , X , 93 ] ->
203- {X , Len - 2 };
204- X ->
205- {X , Len }
206- end ,
207201 case Options # print_options .force_strings of
208202 true ->
209203 {Res , Length };
@@ -611,6 +605,9 @@ binary_printing_test() ->
611605 ? assertEqual (" <<\" hello\\ fworld\" >>" , lists :flatten (format (" ~p " , [<<" hello\f world" >>], 50 ))),
612606 ? assertEqual (" <<\" hello\\ vworld\" >>" , lists :flatten (format (" ~p " , [<<" hello\v world" >>], 50 ))),
613607 ? assertEqual (" hello" , lists :flatten (format (" ~10s " , [<<" hello" >>], 50 ))),
608+ ? assertEqual (" [a]" , lists :flatten (format (" ~s " , [<<" [a]" >>], 50 ))),
609+ ? assertEqual (" [a]" , lists :flatten (format (" ~s " , [[<<" [a]" >>]], 50 ))),
610+
614611 ok .
615612
616613bitstring_printing_test () ->
@@ -679,6 +676,7 @@ iolist_printing_test() ->
679676 lists :flatten (format (" ~s " , [[<<" 123456789" >>, " HellIamaniolist" ]], 13 ))),
680677 ? assertEqual (" 123456789HellIamaniolist" ,
681678 lists :flatten (format (" ~s " , [[<<" 123456789" >>, " HellIamaniolist" ]], 30 ))),
679+
682680 ok .
683681
684682tuple_printing_test () ->
0 commit comments