aboutsummaryrefslogtreecommitdiffstats
path: root/lib/debugger/test/erl_eval_SUITE.erl
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2012-11-10 21:32:31 +0100
committerAnthony Ramine <[email protected]>2013-12-12 12:54:24 +0100
commita0988a638a92211ae0af6ec35ca99edfc05110aa (patch)
treec7aad667d8a85bf543459baa767c2ca21b396ae8 /lib/debugger/test/erl_eval_SUITE.erl
parenta122254898597d73658e72070862e2da0d1cf85b (diff)
downloadotp-a0988a638a92211ae0af6ec35ca99edfc05110aa.tar.gz
otp-a0988a638a92211ae0af6ec35ca99edfc05110aa.tar.bz2
otp-a0988a638a92211ae0af6ec35ca99edfc05110aa.zip
Test named funs
Diffstat (limited to 'lib/debugger/test/erl_eval_SUITE.erl')
-rw-r--r--lib/debugger/test/erl_eval_SUITE.erl26
1 files changed, 24 insertions, 2 deletions
diff --git a/lib/debugger/test/erl_eval_SUITE.erl b/lib/debugger/test/erl_eval_SUITE.erl
index bb2669f450..be9312b68f 100644
--- a/lib/debugger/test/erl_eval_SUITE.erl
+++ b/lib/debugger/test/erl_eval_SUITE.erl
@@ -39,7 +39,8 @@
otp_8133/1,
funs/1,
try_catch/1,
- eval_expr_5/1]).
+ eval_expr_5/1,
+ eep37/1]).
%%
%% Define to run outside of test server
@@ -78,7 +79,7 @@ all() ->
pattern_expr, match_bin, guard_3, guard_4, lc,
simple_cases, unary_plus, apply_atom, otp_5269,
otp_6539, otp_6543, otp_6787, otp_6977, otp_7550,
- otp_8133, funs, try_catch, eval_expr_5].
+ otp_8133, funs, try_catch, eval_expr_5, eep37].
groups() ->
[].
@@ -1323,6 +1324,27 @@ eval_expr_5(Config) when is_list(Config) ->
ok
end.
+eep37(Config) when is_list(Config) ->
+ check(fun () -> (fun _(X) -> X end)(42) end,
+ "(fun _(X) -> X end)(42).",
+ 42),
+ check(fun () -> (fun _Id(X) -> X end)(42) end,
+ "(fun _Id(X) -> X end)(42).", 42),
+ check(fun () -> is_function((fun Self() -> Self end)(), 0) end,
+ "is_function((fun Self() -> Self end)(), 0).",
+ true),
+ check(fun () ->
+ F = fun Fact(N) when N > 0 ->
+ N * Fact(N - 1);
+ Fact(0) ->
+ 1
+ end,
+ F(6)
+ end,
+ "(fun Fact(N) when N > 0 -> N * Fact(N - 1); Fact(0) -> 1 end)(6).",
+ 720),
+ ok.
+
%% Check the string in different contexts: as is; in fun; from compiled code.
check(F, String, Result) ->
check1(F, String, Result),