diff options
author | Björn-Egil Dahlberg <[email protected]> | 2016-12-02 15:08:16 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-12-02 15:08:16 +0100 |
commit | b556c977f0911b32af0e35c378d60d83eaf7b3fe (patch) | |
tree | 9498c2f34afdf53a63f799666493b36aafae7906 /lib/compiler/test | |
parent | 4355489a25795382360fb5ac4ac58f060c331462 (diff) | |
parent | 3ea07934071541d70d8016447b0194c8b551c104 (diff) | |
download | otp-b556c977f0911b32af0e35c378d60d83eaf7b3fe.tar.gz otp-b556c977f0911b32af0e35c378d60d83eaf7b3fe.tar.bz2 otp-b556c977f0911b32af0e35c378d60d83eaf7b3fe.zip |
Merge branch 'egil/compiler/opt-maps-pattern-matching/OTP-14072'
* egil/compiler/opt-maps-pattern-matching/OTP-14072:
compiler: Add regression tests
compiler: Optimize maps pattern matching
compiler: Allow for unaligned match argument in value groups
Diffstat (limited to 'lib/compiler/test')
-rw-r--r-- | lib/compiler/test/regressions_SUITE.erl | 19 |
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(); |