4
%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
4
%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
8
8
%% compliance with the License. You should have received a copy of the
9
9
%% Erlang Public License along with this software. If not, it can be
10
10
%% retrieved online at http://www.erlang.org/.
12
12
%% Software distributed under the License is distributed on an "AS IS"
13
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
%% the License for the specific language governing rights and limitations
15
15
%% under the License.
19
19
-module(match_SUITE).
21
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
22
init_per_group/2,end_per_group/2,
22
23
pmatch/1,mixed/1,aliases/1,match_in_call/1,
23
24
untuplify/1,shortcut_boolean/1,letify_guard/1,
25
selectify/1,underscore/1]).
26
-include("test_server.hrl").
29
test_lib:recompile(?MODULE),
30
[pmatch,mixed,aliases,match_in_call,untuplify,shortcut_boolean,
31
letify_guard,selectify].
27
-include_lib("test_server/include/test_server.hrl").
29
suite() -> [{ct_hooks,[ts_install_cth]}].
32
test_lib:recompile(match_SUITE),
33
[pmatch, mixed, aliases, match_in_call, untuplify,
34
shortcut_boolean, letify_guard, selectify, underscore].
39
init_per_suite(Config) ->
42
end_per_suite(_Config) ->
45
init_per_group(_GroupName, Config) ->
48
end_per_group(_GroupName, Config) ->
33
52
pmatch(Config) when is_list(Config) ->
34
53
?line ok = doit(1),
112
131
?line {42,42,42,42} = multiple_aliases_1(42),
113
132
?line {7,7,7} = multiple_aliases_2(7),
114
133
?line {{a,b},{a,b},{a,b}} = multiple_aliases_3({a,b}),
136
?line {a,b} = list_alias1([a,b]),
137
?line {a,b} = list_alias2([a,b]),
138
?line {a,b} = list_alias3([a,b]),
206
231
multiple_aliases_3((A={_,_}=B)={_,_}=C) ->
234
list_alias1([a,b]=[X,Y]) ->
237
list_alias2([X,Y]=[a,b]) ->
240
list_alias3([X,b]=[a,Y]) ->
211
245
match_in_call(Config) when is_list(Config) ->