diff options
author | Björn Gustavsson <[email protected]> | 2017-10-01 06:52:27 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-10-01 06:52:27 +0200 |
commit | 87deee8a9513714317ce7b620d3260314aad3f1e (patch) | |
tree | 5b6aff4c7e7f92381ee3206b289169151d764e66 /lib/compiler/test/bs_match_SUITE.erl | |
parent | d0875a87fc59bea515294455b2047040118f3a7e (diff) | |
parent | 71a40658a0cef8b3e25df3a8e48a72d0563a89bf (diff) | |
download | otp-87deee8a9513714317ce7b620d3260314aad3f1e.tar.gz otp-87deee8a9513714317ce7b620d3260314aad3f1e.tar.bz2 otp-87deee8a9513714317ce7b620d3260314aad3f1e.zip |
Merge branch 'maint'
* maint:
Fix incorrect internal consistency failure for binary matching code
Diffstat (limited to 'lib/compiler/test/bs_match_SUITE.erl')
-rw-r--r-- | lib/compiler/test/bs_match_SUITE.erl | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/lib/compiler/test/bs_match_SUITE.erl b/lib/compiler/test/bs_match_SUITE.erl index 1da7f68dab..ad48d4c0b7 100644 --- a/lib/compiler/test/bs_match_SUITE.erl +++ b/lib/compiler/test/bs_match_SUITE.erl @@ -39,7 +39,7 @@ match_string_opt/1,select_on_integer/1, map_and_binary/1,unsafe_branch_caching/1, bad_literals/1,good_literals/1,constant_propagation/1, - parse_xml/1,get_payload/1,escape/1]). + parse_xml/1,get_payload/1,escape/1,num_slots_different/1]). -export([coverage_id/1,coverage_external_ignore/2]). @@ -71,7 +71,7 @@ groups() -> match_string_opt,select_on_integer, map_and_binary,unsafe_branch_caching, bad_literals,good_literals,constant_propagation,parse_xml, - get_payload,escape]}]. + get_payload,escape,num_slots_different]}]. init_per_suite(Config) -> @@ -1539,6 +1539,40 @@ escape(<<Byte, Rest/bits>>, Pos) -> escape(<<_Rest/bits>>, Pos) -> Pos. +%% ERL-490 +num_slots_different(_Config) -> + Ts = [{<<"de">>, <<"default">>, <<"Remove">>, <<"a">>}, + {<<"de">>, <<"default">>, <<"Remove from list">>, <<"a">>}, + {<<"de">>, <<"default">>, <<"Remove from the list">>, <<"a">>}, + {<<"de">>, <<"default">>, <<"Results">>, <<"Ergebnisse">>}, + {<<"de">>, <<"default">>, <<"Reservatio">>, <<"a">>}, + {<<"de">>, <<"navigation">>, <<"Results">>, <<"Ergebnisse">>}, + {<<"de">>, <<"navigation">>, <<"Resources">>, <<"Ressourcen">>}], + _ = [{ok,Res} = lgettext(A, B, C) || {A,B,C,Res} <- Ts], + + {'EXIT',_} = (catch lgettext(<<"d">>, <<"default">>, <<"Remove">>)), + {'EXIT',_} = (catch lgettext("", <<"default">>, <<"Remove">>)), + {'EXIT',_} = (catch lgettext(<<"de">>, <<"def">>, <<"Remove">>)), + {'EXIT',_} = (catch lgettext(<<"de">>, <<"default">>, <<"Res">>)), + ok. + + +lgettext(<<"de">>, <<"default">>, <<"Remove">>) -> + {ok, <<"a">>}; +lgettext(<<"de">>, <<"default">>, <<"Remove from list">>) -> + {ok, <<"a">>}; +lgettext(<<"de">>, <<"default">>, <<"Remove from the list">>) -> + {ok, <<"a">>}; +lgettext(<<"de">>, <<"default">>, <<"Results">>) -> + {ok, <<"Ergebnisse">>}; +lgettext(<<"de">>, <<"default">>, <<"Reservatio">>) -> + {ok, <<"a">>}; +lgettext(<<"de">>, <<"navigation">>, <<"Results">>) -> + {ok, <<"Ergebnisse">>}; +lgettext(<<"de">>, <<"navigation">>, <<"Resources">>) -> + {ok, <<"Ressourcen">>}. + + check(F, R) -> R = F(). |