4
%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
6
%% The contents of this file are subject to the Erlang Public License,
7
%% Version 1.1, (the "License"); you may not use this file except in
8
%% compliance with the License. You should have received a copy of the
9
%% Erlang Public License along with this software. If not, it can be
10
%% retrieved online at http://www.erlang.org/.
12
%% Software distributed under the License is distributed on an "AS IS"
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
%% the License for the specific language governing rights and limitations
23
-author('bjorn@erix.ericsson.se').
24
-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,
25
init_per_testcase/2,end_per_testcase/2,
26
init_per_suite/1,end_per_suite/1,
29
-include_lib("test_server/include/test_server.hrl").
31
suite() -> [{ct_hooks,[ts_install_cth]}].
39
init_per_group(_GroupName, Config) ->
42
end_per_group(_GroupName, Config) ->
49
init_per_testcase(_Case, Config) ->
50
test_lib:interpret(?MODULE),
51
Dog = test_server:timetrap(?t:minutes(1)),
52
[{watchdog,Dog}|Config].
54
end_per_testcase(_Case, Config) ->
55
Dog = ?config(watchdog, Config),
56
?t:timetrap_cancel(Dog),
59
init_per_suite(Config) when is_list(Config) ->
60
?line test_lib:interpret(?MODULE),
61
?line true = lists:member(?MODULE, int:interpreted()),
64
end_per_suite(Config) when is_list(Config) ->
67
basic(Config) when list(Config) ->
68
?line L0 = lists:seq(1, 10),
69
?line L1 = my_map(fun(X) -> {x,X} end, L0),
70
?line L1 = [{x,X} || X <- L0],
71
?line L0 = my_map(fun({x,X}) -> X end, L1),
72
?line [1,2,3,4,5] = [X || X <- L0, X < 6],
73
?line [4,5,6] = [X || X <- L0, X > 3, X < 7],
74
?line [] = [X || X <- L0, X > 32, X < 7],
75
?line [1,3,5,7,9] = [X || X <- L0, odd(X)],
78
?line [] = [X || X <- L1, X+1 < 2],
79
?line [] = [{xx,X} || X <- L0, element(2, X) == no_no_no],
80
?line {'EXIT',_} = (catch [X || X <- L1, odd(X)]),