~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/compiler/test/match_SUITE.erl

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%%
2
2
%% %CopyrightBegin%
3
 
%% 
4
 
%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
5
 
%% 
 
3
%%
 
4
%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
 
5
%%
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/.
11
 
%% 
 
11
%%
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.
16
 
%% 
 
16
%%
17
17
%% %CopyrightEnd%
18
18
%%
19
19
-module(match_SUITE).
20
20
 
21
 
-export([all/1,
 
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,
24
 
         selectify/1]).
 
25
         selectify/1,underscore/1]).
25
26
         
26
 
-include("test_server.hrl").
27
 
 
28
 
all(suite) ->
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").
 
28
 
 
29
suite() -> [{ct_hooks,[ts_install_cth]}].
 
30
 
 
31
all() -> 
 
32
    test_lib:recompile(match_SUITE),
 
33
    [pmatch, mixed, aliases, match_in_call, untuplify,
 
34
     shortcut_boolean, letify_guard, selectify, underscore].
 
35
 
 
36
groups() -> 
 
37
    [].
 
38
 
 
39
init_per_suite(Config) ->
 
40
    Config.
 
41
 
 
42
end_per_suite(_Config) ->
 
43
    ok.
 
44
 
 
45
init_per_group(_GroupName, Config) ->
 
46
    Config.
 
47
 
 
48
end_per_group(_GroupName, Config) ->
 
49
    Config.
 
50
 
32
51
 
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}),
 
134
 
 
135
    %% Lists/literals.
 
136
    ?line {a,b} = list_alias1([a,b]),
 
137
    ?line {a,b} = list_alias2([a,b]),
 
138
    ?line {a,b} = list_alias3([a,b]),
 
139
 
115
140
    ok.
116
141
 
117
142
str_alias(V) ->
206
231
multiple_aliases_3((A={_,_}=B)={_,_}=C) ->
207
232
    {A,B,C}.
208
233
 
 
234
list_alias1([a,b]=[X,Y]) ->
 
235
    {X,Y}.
 
236
 
 
237
list_alias2([X,Y]=[a,b]) ->
 
238
    {X,Y}.
 
239
 
 
240
list_alias3([X,b]=[a,Y]) ->
 
241
    {X,Y}.
 
242
 
209
243
%% OTP-7018.
210
244
 
211
245
match_in_call(Config) when is_list(Config) ->
352
386
sel_same_value2(_) ->
353
387
    error.
354
388
 
 
389
underscore(Config) when is_list(Config) ->
 
390
    case Config of
 
391
        [] ->
 
392
            %% Assignment to _ at the end of a construct.
 
393
            _ = length(Config);
 
394
        [_|_] ->
 
395
            %% Assignment to _ at the end of a construct.
 
396
            _ = list_to_tuple(Config)
 
397
    end,
 
398
    _ = is_list(Config),
 
399
    ok.
 
400
 
355
401
id(I) -> I.