diff options
author | Bruce Yinhe <[email protected]> | 2014-07-09 11:26:59 +0200 |
---|---|---|
committer | Bruce Yinhe <[email protected]> | 2014-07-09 11:26:59 +0200 |
commit | 2c7c3230ad2f759592308d5a5210c60bc39b3dd6 (patch) | |
tree | fa3ce2a89dbab24f6a4200bbc2f182112033f59c /lib | |
parent | 68d2b742d4720c5edfee8e4465df3357ff2c18d2 (diff) | |
parent | d78e98eeb00fbb250385e1aa99c23a74e5baed86 (diff) | |
download | otp-2c7c3230ad2f759592308d5a5210c60bc39b3dd6.tar.gz otp-2c7c3230ad2f759592308d5a5210c60bc39b3dd6.tar.bz2 otp-2c7c3230ad2f759592308d5a5210c60bc39b3dd6.zip |
Merge branch 'lucafavatella/refactor-eunit-check_arity' into maint
OTP-12051
* lucafavatella/refactor-eunit-check_arity:
Refactor function in eunit using is_function/2
Diffstat (limited to 'lib')
-rw-r--r-- | lib/eunit/src/eunit_data.erl | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/eunit/src/eunit_data.erl b/lib/eunit/src/eunit_data.erl index 0350f9bf6e..cbbc6fbc15 100644 --- a/lib/eunit/src/eunit_data.erl +++ b/lib/eunit/src/eunit_data.erl @@ -440,13 +440,8 @@ parse_function({M, F}) when is_atom(M), is_atom(F) -> parse_function(F) -> bad_test(F). -check_arity(F, N, T) when is_function(F) -> - case erlang:fun_info(F, arity) of - {arity, N} -> - ok; - _ -> - bad_test(T) - end; +check_arity(F, N, _) when is_function(F, N) -> + ok; check_arity(_, _, T) -> bad_test(T). |