diff options
author | Lukas Larsson <[email protected]> | 2017-04-25 14:18:00 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2017-04-25 14:18:00 +0200 |
commit | 483e3fb7b81e352944226b7d230e6a8685576982 (patch) | |
tree | afb1e99b530c4d4ff52166ee0ed7f7b8cc466f8a /erts/emulator/test | |
parent | 8ca868848600702696828d729387343d73311a50 (diff) | |
parent | eec41eeed17682a4e1f8ca15d92a2b469f0c39b8 (diff) | |
download | otp-483e3fb7b81e352944226b7d230e6a8685576982.tar.gz otp-483e3fb7b81e352944226b7d230e6a8685576982.tar.bz2 otp-483e3fb7b81e352944226b7d230e6a8685576982.zip |
Merge branch 'lukas/erts/list_to_port/OTP-14348'
* lukas/erts/list_to_port/OTP-14348:
erts: Add erlang:list_to_port/1 debug bif
erts: Auto-import port_to_list for consistency
erts: Polish off erlang:list_to_ref/1
Diffstat (limited to 'erts/emulator/test')
-rw-r--r-- | erts/emulator/test/list_bif_SUITE.erl | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/erts/emulator/test/list_bif_SUITE.erl b/erts/emulator/test/list_bif_SUITE.erl index 9c40929926..08574bff71 100644 --- a/erts/emulator/test/list_bif_SUITE.erl +++ b/erts/emulator/test/list_bif_SUITE.erl @@ -23,7 +23,7 @@ -export([all/0, suite/0]). -export([hd_test/1,tl_test/1,t_length/1,t_list_to_pid/1, - t_list_to_float/1,t_list_to_integer/1]). + t_list_to_port/1,t_list_to_float/1,t_list_to_integer/1]). suite() -> @@ -32,7 +32,7 @@ suite() -> all() -> - [hd_test, tl_test, t_length, t_list_to_pid, + [hd_test, tl_test, t_length, t_list_to_pid, t_list_to_port, t_list_to_float, t_list_to_integer]. %% Tests list_to_integer and string:to_integer @@ -106,10 +106,25 @@ t_list_to_pid(Config) when is_list(Config) -> {'EXIT', {badarg, _}} -> ok; Res -> - ct:fail("list_to_pid/1 with incorrect arg succeeded.~nResult: ~p", [Res]) + ct:fail("list_to_pid/1 with incorrect arg succeeded.~n" + "Result: ~p", [Res]) end, ok. +%% Test list_to_port/1 with correct and incorrect arguments. + +t_list_to_port(Config) when is_list(Config) -> + Me = hd(erlang:ports()), + MyListedPid = port_to_list(Me), + Me = list_to_port(MyListedPid), + case catch list_to_port(id("Incorrect list")) of + {'EXIT', {badarg, _}} -> + ok; + Res -> + ct:fail("list_to_port/1 with incorrect arg succeeded.~n" + "Result: ~p", [Res]) + end, + ok. %% Test list_to_float/1 with correct and incorrect arguments. |