diff options
author | Lukas Larsson <[email protected]> | 2017-04-21 14:54:33 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2017-04-25 14:17:18 +0200 |
commit | eec41eeed17682a4e1f8ca15d92a2b469f0c39b8 (patch) | |
tree | d67679c453a4033959dfc3cd09d71e5c4c6e558b /erts/emulator/test | |
parent | ab048d66c59fa827bf4129fc95bec21488a931a4 (diff) | |
download | otp-eec41eeed17682a4e1f8ca15d92a2b469f0c39b8.tar.gz otp-eec41eeed17682a4e1f8ca15d92a2b469f0c39b8.tar.bz2 otp-eec41eeed17682a4e1f8ca15d92a2b469f0c39b8.zip |
erts: Add erlang:list_to_port/1 debug bif
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 514dd2f412..9e1e351cd2 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. |