aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorStanislav Mayorov <[email protected]>2018-12-13 11:39:16 +0700
committerJohn Högberg <[email protected]>2019-01-10 09:39:29 +0100
commita56bc7180c639f1f08355f22e22cf539db16982c (patch)
tree5b9549f2cd5c5a9d10dead20c1c40f501dbfa185 /erts/emulator/test
parent6120af3481f9deac2be1ff4bbb2684f24ef172eb (diff)
downloadotp-a56bc7180c639f1f08355f22e22cf539db16982c.tar.gz
otp-a56bc7180c639f1f08355f22e22cf539db16982c.tar.bz2
otp-a56bc7180c639f1f08355f22e22cf539db16982c.zip
Accept base in all integer-printing functions
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/num_bif_SUITE.erl14
1 files changed, 10 insertions, 4 deletions
diff --git a/erts/emulator/test/num_bif_SUITE.erl b/erts/emulator/test/num_bif_SUITE.erl
index f15217814a..6b834705cf 100644
--- a/erts/emulator/test/num_bif_SUITE.erl
+++ b/erts/emulator/test/num_bif_SUITE.erl
@@ -504,6 +504,10 @@ t_integer_to_string(Config) when is_list(Config) ->
test_its("A", 10, 16),
test_its("D4BE", 54462, 16),
test_its("-D4BE", -54462, 16),
+ test_its("FFFFFFFFFF", 1099511627775, 16),
+ test_its("123456789ABCDEF123456789ABCDEF123456789ABCDEF",
+ 108977460683796539709587792812439445667270661579197935,
+ 16),
lists:foreach(fun(Value) ->
{'EXIT', {badarg, _}} =
@@ -515,12 +519,14 @@ t_integer_to_string(Config) when is_list(Config) ->
ok.
test_its(List,Int) ->
- Int = list_to_integer(List),
- Int = binary_to_integer(list_to_binary(List)).
+ List = integer_to_list(Int),
+ Binary = list_to_binary(List),
+ Binary = integer_to_binary(Int).
test_its(List,Int,Base) ->
- Int = list_to_integer(List, Base),
- Int = binary_to_integer(list_to_binary(List), Base).
+ List = integer_to_list(Int, Base),
+ Binary = list_to_binary(List),
+ Binary = integer_to_binary(Int, Base).
%% Tests binary_to_integer/1.