4848 t_float_to_string /1 , t_integer_to_string /1 ,
4949 t_string_to_integer /1 , t_list_to_integer_edge_cases /1 ,
5050 t_string_to_float_safe /1 , t_string_to_float_risky /1 ,
51- t_round /1 , t_trunc_and_friends /1 ,
51+ t_round /1 , t_trunc_and_friends /1 ,
5252 t_based_float /1 , t_binary_to_float_2 /1
5353 ]).
5454
@@ -461,12 +461,12 @@ t_based_float(Config) when is_list(Config) ->
461461 % % Test many trailing zeroes
462462 OneDotZero = " 1.0" ++ lists :duplicate (10_000 , $0 ),
463463 _ = [? assertEqual (1.0 , list_to_float (OneDotZero , Base )) ||
464- Base <- lists :seq (2 , 36 )],
464+ Base <- lists :seq (2 , 36 )],
465465
466466 % % Test random floats
467467 _ = [test_rand_bfs (Base ) ||
468- _ <- lists :seq (1 , 50 ),
469- Base <- lists :seq (2 , 36 )],
468+ _ <- lists :seq (1 , 50 ),
469+ Base <- lists :seq (2 , 36 )],
470470
471471 % % Error cases
472472 ? assertError (badarg , float_to_list (1.0 , [{base , 1 }])),
@@ -485,7 +485,7 @@ t_based_float(Config) when is_list(Config) ->
485485
486486 HugeInt = lists :duplicate (10_000 , $1 ) ++ " .0" ,
487487 _ = [? assertError (badarg , list_to_float (HugeInt , Base )) ||
488- Base <- lists :seq (2 , 36 )],
488+ Base <- lists :seq (2 , 36 )],
489489
490490 ok .
491491
@@ -504,14 +504,14 @@ test_rand_bfs(Base) ->
504504 Expect = float_to_list (F , [{base , Base }, short ]),
505505 % io:format("~p: ~p ~ts\n", [Base, F, Expect]),
506506 case Base band (Base - 1 ) of
507- 0 ->
508- % % Power of two. Exact roundtrip is possible.
509- test_bfs (Expect , F , [{base , Base }, short ]);
510- _ ->
511- % % Exact roundtrip might not be possible.
512- BinExpect = list_to_binary (Expect ),
513- ok = fcmp (F , list_to_float (Expect , Base )),
514- ok = fcmp (F , binary_to_float (BinExpect , Base ))
507+ 0 ->
508+ % % Power of two. Exact roundtrip is possible.
509+ test_bfs (Expect , F , [{base , Base }, short ]);
510+ _ ->
511+ % % Exact roundtrip might not be possible.
512+ BinExpect = list_to_binary (Expect ),
513+ ok = fcmp (F , list_to_float (Expect , Base )),
514+ ok = fcmp (F , binary_to_float (BinExpect , Base ))
515515 end .
516516
517517fcmp (F1 , F2 ) when F1 == 0.0 , F2 == 0.0 -> ok ;
@@ -747,9 +747,9 @@ t_integer_to_string(Config) when is_list(Config) ->
747747
748748 % % Invalid types
749749 lists :foreach (fun (Value ) ->
750- ? assertError (badarg , erlang :integer_to_binary (Value )),
751- ? assertError (badarg , erlang :integer_to_list (Value ))
752- end ,[atom ,1.2 ,0.0 ,[$1 ,[$2 ]]]),
750+ ? assertError (badarg , erlang :integer_to_binary (Value )),
751+ ? assertError (badarg , erlang :integer_to_list (Value ))
752+ end ,[atom ,1.2 ,0.0 ,[$1 ,[$2 ]]]),
753753
754754 % % Base-2 integers
755755 test_its (" 0" , 0 , 2 ),
@@ -767,9 +767,9 @@ t_integer_to_string(Config) when is_list(Config) ->
767767 16 ),
768768
769769 lists :foreach (fun (Value ) ->
770- ? assertError (badarg , erlang :integer_to_binary (Value , 8 )),
771- ? assertError (badarg , erlang :integer_to_list (Value , 8 ))
772- end ,[atom ,1.2 ,0.0 ,[$1 ,[$2 ]]]),
770+ ? assertError (badarg , erlang :integer_to_binary (Value , 8 )),
771+ ? assertError (badarg , erlang :integer_to_list (Value , 8 ))
772+ end ,[atom ,1.2 ,0.0 ,[$1 ,[$2 ]]]),
773773
774774 ok .
775775
0 commit comments