diff options
author | Anthony Ramine <[email protected]> | 2012-11-10 21:32:31 +0100 |
---|---|---|
committer | Anthony Ramine <[email protected]> | 2013-12-12 12:54:24 +0100 |
commit | a0988a638a92211ae0af6ec35ca99edfc05110aa (patch) | |
tree | c7aad667d8a85bf543459baa767c2ca21b396ae8 /erts/emulator/test/fun_SUITE.erl | |
parent | a122254898597d73658e72070862e2da0d1cf85b (diff) | |
download | otp-a0988a638a92211ae0af6ec35ca99edfc05110aa.tar.gz otp-a0988a638a92211ae0af6ec35ca99edfc05110aa.tar.bz2 otp-a0988a638a92211ae0af6ec35ca99edfc05110aa.zip |
Test named funs
Diffstat (limited to 'erts/emulator/test/fun_SUITE.erl')
-rw-r--r-- | erts/emulator/test/fun_SUITE.erl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/erts/emulator/test/fun_SUITE.erl b/erts/emulator/test/fun_SUITE.erl index 36ba4e0f48..8ad5f290ed 100644 --- a/erts/emulator/test/fun_SUITE.erl +++ b/erts/emulator/test/fun_SUITE.erl @@ -262,6 +262,16 @@ equality(Config) when is_list(Config) -> ?line false = eq(FF2, FF4), ?line false = eq(FF3, FF4), + %% EEP37 + H1 = fun Fact(N) when N > 0 -> N * Fact(N - 1); Fact(0) -> 1 end, + H2 = fun Pow(N, M) when M > 0 -> N * Pow(N, M - 1); Pow(_, 0) -> 1 end, + H1_copy = copy_term(H1), + + true = eq(H1, H1), + true = eq(H1, H1_copy), + true = eq(H2, H2), + false = eq(H1, H2), + ok. eq(X, X) -> true; |