aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorMagnus Henoch <[email protected]>2019-07-12 14:38:05 +0100
committerMagnus Henoch <[email protected]>2019-07-12 14:38:05 +0100
commita69d7ba56ad1f0983c6aea7538742d2a1c4e1d7a (patch)
tree0acf98f7d9e804c64f1209a205138d6aebededde /lib/stdlib/test
parent7e77fb475fb8054b19e8e5ed3ed81d2c5950a0ff (diff)
downloadotp-a69d7ba56ad1f0983c6aea7538742d2a1c4e1d7a.tar.gz
otp-a69d7ba56ad1f0983c6aea7538742d2a1c4e1d7a.tar.bz2
otp-a69d7ba56ad1f0983c6aea7538742d2a1c4e1d7a.zip
fun2ms: accept ++ in function head when called from shell
Code such as ets:fun2ms(fun({"foo" ++ X}) -> X end) works fine in compiled code. Let's make it work when fun2ms is invoked from the shell as well.
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/ms_transform_SUITE.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/stdlib/test/ms_transform_SUITE.erl b/lib/stdlib/test/ms_transform_SUITE.erl
index d1e6faf863..29423ed032 100644
--- a/lib/stdlib/test/ms_transform_SUITE.erl
+++ b/lib/stdlib/test/ms_transform_SUITE.erl
@@ -281,6 +281,8 @@ basic_ets(Config) when is_list(Config) ->
compile_and_run(<<"ets:fun2ms(fun({A,B}) -> {B,A} end)">>),
[{{'$1','$2'},[],[['$2','$1']]}] =
compile_and_run(<<"ets:fun2ms(fun({A,B}) -> [B,A] end)">>),
+ [{{"foo" ++ '_','$1'},[],['$1']}] =
+ compile_and_run(<<"ets:fun2ms(fun({\"foo\" ++ _, X}) -> X end)">>),
ok.
%% Tests basic ets:fun2ms.
@@ -313,6 +315,8 @@ from_shell(Config) when is_list(Config) ->
[{[a,b],[],[{message,banan},{return_trace}]}] =
do_eval(
"dbg:fun2ms(fun([a,b]) -> message(banan), return_trace() end)"),
+ [{{"foo" ++ '_','$1'},[],['$1']}] =
+ do_eval("ets:fun2ms(fun({\"foo\" ++ _, X}) -> X end)"),
ok.
%% Tests expansion of records in fun2ms.