diff options
author | Björn Gustavsson <[email protected]> | 2010-05-08 09:23:15 +0200 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2010-05-20 12:20:51 +0200 |
commit | 3bac5820d497547c7f307ed227aca5665a10e321 (patch) | |
tree | 86495d5ae2ff9282f21513f98d7577c8aca29e9e | |
parent | f49f2916ab5d609b44c4233bced10dcc6804cd8a (diff) | |
download | otp-3bac5820d497547c7f307ed227aca5665a10e321.tar.gz otp-3bac5820d497547c7f307ed227aca5665a10e321.tar.bz2 otp-3bac5820d497547c7f307ed227aca5665a10e321.zip |
v3_core tests: Cover handling of pattern aliases
-rw-r--r-- | lib/compiler/test/match_SUITE.erl | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/compiler/test/match_SUITE.erl b/lib/compiler/test/match_SUITE.erl index 9c4687efa1..fd51b777ac 100644 --- a/lib/compiler/test/match_SUITE.erl +++ b/lib/compiler/test/match_SUITE.erl @@ -112,6 +112,12 @@ aliases(Config) when is_list(Config) -> ?line {42,42,42,42} = multiple_aliases_1(42), ?line {7,7,7} = multiple_aliases_2(7), ?line {{a,b},{a,b},{a,b}} = multiple_aliases_3({a,b}), + + %% Lists/literals. + ?line {a,b} = list_alias1([a,b]), + ?line {a,b} = list_alias2([a,b]), + ?line {a,b} = list_alias3([a,b]), + ok. str_alias(V) -> @@ -206,6 +212,15 @@ multiple_aliases_2((A=B)=(A=C)) -> multiple_aliases_3((A={_,_}=B)={_,_}=C) -> {A,B,C}. +list_alias1([a,b]=[X,Y]) -> + {X,Y}. + +list_alias2([X,Y]=[a,b]) -> + {X,Y}. + +list_alias3([X,b]=[a,Y]) -> + {X,Y}. + %% OTP-7018. match_in_call(Config) when is_list(Config) -> |