aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-09-16 17:36:26 +0200
committerBjörn-Egil Dahlberg <[email protected]>2016-12-01 15:24:02 +0100
commit3ea07934071541d70d8016447b0194c8b551c104 (patch)
treeb190c28338782237affdb6817e50ff8e55e734e1 /lib/compiler/test
parentcaa3c36a331009fa69c7a524090f455e9e296987 (diff)
downloadotp-3ea07934071541d70d8016447b0194c8b551c104.tar.gz
otp-3ea07934071541d70d8016447b0194c8b551c104.tar.bz2
otp-3ea07934071541d70d8016447b0194c8b551c104.zip
compiler: Add regression tests
Diffstat (limited to 'lib/compiler/test')
-rw-r--r--lib/compiler/test/regressions_SUITE.erl19
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/compiler/test/regressions_SUITE.erl b/lib/compiler/test/regressions_SUITE.erl
index 7d2c2ac974..7a6fe08c73 100644
--- a/lib/compiler/test/regressions_SUITE.erl
+++ b/lib/compiler/test/regressions_SUITE.erl
@@ -24,7 +24,7 @@
-export([all/0,groups/0,init_per_testcase/2,end_per_testcase/2,suite/0]).
-export([maps/1]).
-groups() ->
+groups() ->
[{p,test_lib:parallel(),
[maps]}].
@@ -38,7 +38,7 @@ suite() ->
[{ct_hooks,[ts_install_cth]},
{timetrap,{minutes,2}}].
-all() ->
+all() ->
test_lib:recompile(?MODULE),
[{group,p}].
@@ -48,7 +48,18 @@ maps(Config) when is_list(Config) ->
Ts = [{beam_bool_get_elements,
<<"century(#{ron := operator}, _century) ->
if 0.0; _century, _century, _century -> _century end.
- ">>}],
+ ">>},
+ {empty_map_clauses,
+ <<"politics(#{}, researchers) -> concerned;
+ politics(#{[] := _}, workers) -> dot;
+ politics(#{[] := ct}, counsel) -> calls.
+ ">>},
+ {empty_map_clauses_variable,
+ <<"georgia(#{a := effectively}, ratio, is, eventually) -> teens;
+ georgia(#{a := government}, knowledge, poker, partly) -> signed;
+ georgia(#{}, recording, bring, vital) -> divided;
+ georgia(#{0 := 0}, articles, brought, #{true := true, a := There}) -> There.
+ ">>}],
ok = run(Config, Ts),
ok.
@@ -58,7 +69,7 @@ run(Config, Tests) ->
F = fun({N,P}) ->
io:format("Compiling test for: ~w~n", [N]),
case catch run_test(Config, P) of
- {'EXIT', Reason} ->
+ {'EXIT', Reason} ->
io:format("~nTest ~p failed.~nReason: ~p~n",
[N, Reason]),
fail();