aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-08-21 16:32:52 +0200
committerBjörn-Egil Dahlberg <[email protected]>2014-08-21 16:32:52 +0200
commited5a0b9cdf6a7e87cec1a50c6e9adb29698ce8d9 (patch)
tree4b9f103d907d336a45cc4efe1e8f59d95ec29ec1 /erts/emulator/test
parentcffe162d9ddce58b2aaf71a102f3b6c6738a2029 (diff)
parente2148351cd40a8affacf6fc0589448d15bc603f7 (diff)
downloadotp-ed5a0b9cdf6a7e87cec1a50c6e9adb29698ce8d9.tar.gz
otp-ed5a0b9cdf6a7e87cec1a50c6e9adb29698ce8d9.tar.bz2
otp-ed5a0b9cdf6a7e87cec1a50c6e9adb29698ce8d9.zip
Merge branch 'egil/proc_lib-optimizations/OTP-12060' into maint
* egil/proc_lib-optimizations/OTP-12060: stdlib: Update dependencies to erts-6.2 erts: Update preloaded erlang.beam stdlib: Use erlang:fun_info_mfa/1 in proc_lib:init_p/3 erts: Test erlang:fun_info_mfa/1 erts: Introduce erlang:fun_info_mfa/1
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/fun_SUITE.erl23
1 files changed, 21 insertions, 2 deletions
diff --git a/erts/emulator/test/fun_SUITE.erl b/erts/emulator/test/fun_SUITE.erl
index 8ad5f290ed..2968f5bebb 100644
--- a/erts/emulator/test/fun_SUITE.erl
+++ b/erts/emulator/test/fun_SUITE.erl
@@ -30,7 +30,7 @@
fun_to_port/1,t_hash/1,t_phash/1,t_phash2/1,md5/1,
refc/1,refc_ets/1,refc_dist/1,
const_propagation/1,t_arity/1,t_is_function2/1,
- t_fun_info/1]).
+ t_fun_info/1,t_fun_info_mfa/1]).
-export([nothing/0]).
@@ -42,7 +42,8 @@ all() ->
[bad_apply, bad_fun_call, badarity, ext_badarity,
equality, ordering, fun_to_port, t_hash, t_phash,
t_phash2, md5, refc, refc_ets, refc_dist,
- const_propagation, t_arity, t_is_function2, t_fun_info].
+ const_propagation, t_arity, t_is_function2, t_fun_info,
+ t_fun_info_mfa].
groups() ->
[].
@@ -824,6 +825,24 @@ t_fun_info(Config) when is_list(Config) ->
?line bad_info(<<1,2>>),
ok.
+t_fun_info_mfa(Config) when is_list(Config) ->
+ Fun1 = fun spawn_call/2,
+ {module,M1} = erlang:fun_info(Fun1, module),
+ {name,F1} = erlang:fun_info(Fun1, name),
+ {arity,A1} = erlang:fun_info(Fun1, arity),
+ {M1,F1,A1=2} = erlang:fun_info_mfa(Fun1),
+ %% Module fun.
+ Fun2 = fun ?MODULE:t_fun_info/1,
+ {module,M2} = erlang:fun_info(Fun2, module),
+ {name,F2} = erlang:fun_info(Fun2, name),
+ {arity,A2} = erlang:fun_info(Fun2, arity),
+ {M2,F2,A2=1} = erlang:fun_info_mfa(Fun2),
+
+ %% Not fun.
+ {'EXIT',_} = (catch erlang:fun_info_mfa(id(d))),
+ ok.
+
+
bad_info(Term) ->
try erlang:fun_info(Term, module) of
Any ->