~statik/ubuntu/maverick/erlang/erlang-merge-testing

« back to all changes in this revision

Viewing changes to lib/erl_interface/test/ei_format_SUITE.erl

  • Committer: Elliot Murphy
  • Date: 2010-06-08 03:55:44 UTC
  • mfrom: (3.5.6 squeeze)
  • Revision ID: elliot@elliotmurphy.com-20100608035544-dd8zh2swk7jr5rz2
* Merge with Debian unstable; remaining Ubuntu changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to. (LP #438365)
  - 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.
* Added missing symlinks to /usr/include for a few new header files.
* Fixed generation of ${erlang-base:Depends} and ${erlang-x11:Depends}
  substitution variables.
* Added a fix for a re:compile/2 crash on a long regular expression.
* Changed urgency to medium as the change fixes a security bug.
* Manpages in section 1 are needed even if only arch-dependent packages are
  built. So, re-enabled them.
* Fixed HiPE architecture recognition for powerpc Debian architecture.
* Moved xsltproc and fop to build-depends-indep and do not build
  documentation if only architecture-specific packages are built.
* Refreshed all patches.
* Made Emacs look in man5 and man7 for Erlang manpages and added code
  skeleton files to erlang-mode package.
* New upstream release.
* Moved manpages from incorrect sections 4 and 6 to correct 5 and 7
  (closes: #498492).
* Made manpages regexp in Emacs mode match only 3erl pages in section 3.
* Removed docb_gen script which is no longer needed to build manpages.
* Added erlang-doc package which contains documentation in HTML and PDF
  formats. This package replaces erlang-doc-html package and it's easier
  to synchronize it with the main Erlang packages as it's built from
  a single source package (closes: #558451).
* Removed RPATH from ssl and crypto application binaries as required by
  Debian policy.
* Added libwxgtk2.4-dev and libwxgtk2.6-dev to build conflicts.
* Added a few dpendencies for erlang-dialyzer, erlang-et, erlang-observer
  and erlang-examples packages which now call functions from more modules
  than in 1:13.b.3.
* Added a workaround which disables vfork() for hppa architecture
  (closes: #562218).
* Strictened check for JDK 1.5 adding a call to String(int[], int, int)
  because GCJ 4.4 doesn't implement it and OpenJDK isn't available for all
  architectures.
* Fixed erlang-manpages package section.
* Made erlang-depends add only substvars which are requested in
  debian/control file. This minimizes number of warnings from dh_gencontrol.
  Also, improved descriptions of the functions in erlang-depends escript.
* Added erlang-erl-docgen package to erlang-nox dependencies.
* Made dummy packages erlang-nox and erlang-x11 architecture all.
* Cleaned up working with custom substitution variables in debian/rules.
* Reorganized debian/rules to ensure that manpages arent built twice, and
  aren't built at all if only architecture-dependent packages are requested.
* Fixed project links in README.Debian.
* Added a new package erlang-jinterface which provides tools for
  communication of Java programs with Erlang processes. This adds build
  depandency on default-jdk and as a result enables Java module for IDL
  compiler.
* Bumped standards version to 3.8.4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%
 
2
%% %CopyrightBegin%
 
3
%% 
 
4
%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
 
5
%% 
 
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/.
 
11
%% 
 
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
 
15
%% under the License.
 
16
%% 
 
17
%% %CopyrightEnd%
 
18
%%
 
19
 
 
20
%%
 
21
-module(ei_format_SUITE).
 
22
 
 
23
-include("test_server.hrl").
 
24
-include("ei_format_SUITE_data/ei_format_test_cases.hrl").
 
25
 
 
26
-export([
 
27
        format_wo_ver/1,
 
28
        all/1, 
 
29
        atoms/1, 
 
30
        tuples/1, 
 
31
        lists/1
 
32
        ]).
 
33
 
 
34
-import(runner, [get_term/1]).
 
35
 
 
36
%% This test suite test the erl_format() function.
 
37
%% It uses the port program "ei_format_test".
 
38
 
 
39
all(suite) -> [
 
40
        format_wo_ver,
 
41
        atoms, 
 
42
        tuples, 
 
43
        lists
 
44
        ].
 
45
 
 
46
%% Tests formatting various atoms.
 
47
 
 
48
atoms(suite) -> [];
 
49
atoms(Config) when is_list(Config) ->
 
50
    ?line P = runner:start(?atoms),
 
51
 
 
52
    ?line {term, ''} = get_term(P),
 
53
    ?line {term, 'a'} = get_term(P),
 
54
    ?line {term, 'A'} = get_term(P),
 
55
    ?line {term, 'abc'} = get_term(P),
 
56
    ?line {term, 'Abc'} = get_term(P),
 
57
    ?line {term, 'ab@c'} = get_term(P),
 
58
    ?line {term, 'The rain in Spain stays mainly in the plains'} =
 
59
        get_term(P),
 
60
 
 
61
    ?line {term, a} = get_term(P),
 
62
    ?line {term, ab} = get_term(P),
 
63
    ?line {term, abc} = get_term(P),
 
64
    ?line {term, ab@c} = get_term(P),
 
65
    ?line {term, abcdefghijklmnopq} = get_term(P),
 
66
 
 
67
    ?line {term, ''} = get_term(P),
 
68
    ?line {term, 'a'} = get_term(P),
 
69
    ?line {term, 'A'} = get_term(P),
 
70
    ?line {term, 'abc'} = get_term(P),
 
71
    ?line {term, 'Abc'} = get_term(P),
 
72
    ?line {term, 'ab@c'} = get_term(P),
 
73
    ?line {term, 'The rain in Spain stays mainly in the plains'} =
 
74
        get_term(P),
 
75
 
 
76
    ?line {term, a} = get_term(P),
 
77
    ?line {term, ab} = get_term(P),
 
78
    ?line {term, abc} = get_term(P),
 
79
    ?line {term, ab@c} = get_term(P),
 
80
    ?line {term, '   abcdefghijklmnopq   '} = get_term(P),
 
81
 
 
82
    ?line runner:recv_eot(P),
 
83
    ok.
 
84
 
 
85
 
 
86
 
 
87
%% Tests formatting various tuples
 
88
 
 
89
tuples(suite) -> [];
 
90
tuples(Config) when is_list(Config) ->
 
91
    ?line P = runner:start(?tuples),
 
92
 
 
93
    ?line {term, {}} = get_term(P),
 
94
    ?line {term, {a}} = get_term(P),
 
95
    ?line {term, {a, b}} = get_term(P),
 
96
    ?line {term, {a, b, c}} = get_term(P),
 
97
    ?line {term, {1}} = get_term(P),
 
98
    ?line {term, {[]}} = get_term(P),
 
99
    ?line {term, {[], []}} = get_term(P),
 
100
    ?line {term, {[], a, b, c}} = get_term(P),
 
101
    ?line {term, {[], a, [], b, c}} = get_term(P),
 
102
    ?line {term, {[], a, '', b, c}} = get_term(P),
 
103
 
 
104
    ?line runner:recv_eot(P),
 
105
    ok.
 
106
 
 
107
 
 
108
 
 
109
%% Tests formatting various lists
 
110
 
 
111
lists(suite) -> [];
 
112
lists(Config) when is_list(Config) ->
 
113
    ?line P = runner:start(?lists),
 
114
 
 
115
    ?line {term, []} = get_term(P),
 
116
    ?line {term, [a]} = get_term(P),
 
117
    ?line {term, [a, b]} = get_term(P),
 
118
    ?line {term, [a, b, c]} = get_term(P),
 
119
    ?line {term, [1]} = get_term(P),
 
120
    ?line {term, [[]]} = get_term(P),
 
121
    ?line {term, [[], []]} = get_term(P),
 
122
    ?line {term, [[], a, b, c]} = get_term(P),
 
123
    ?line {term, [[], a, [], b, c]} = get_term(P),
 
124
    ?line {term, [[], a, '', b, c]} = get_term(P),
 
125
    ?line {term, [[x, 2], [y, 3], [z, 4]]}= get_term(P),
 
126
    ?line {term, [{a,b},{c,d}]}= get_term(P),
 
127
%%    ?line {term, [{name, 'Madonna'}, {age, 21}, {data, [{addr, "E-street", 42}]}]} = 
 
128
%%      get_term(P),
 
129
    
 
130
    ?line {term, [{pi, F1}, {'cos(70)', F2}]} = get_term(P),
 
131
    %% don't match floats directly
 
132
    true= abs(3.1415-F1) < 0.01,
 
133
    true= abs(0.34202-F2) < 0.01,
 
134
 
 
135
    ?line {term, [[pi, F3], ['cos(70)', F4]]} = get_term(P),
 
136
    true= abs(3.1415-F3) < 0.01,
 
137
    true= abs(0.34202-F4) < 0.01,
 
138
 
 
139
 
 
140
%%    ?line {term, [[pi, 3.1415], [], ["cos(70)", 0.34202]]} = get_term(P),
 
141
    ?line {term, [-1]} = get_term(P),
 
142
    ?line {term, "hejsan"} = get_term(P),
 
143
 
 
144
 
 
145
    ?line Str1 = lists:duplicate(65535,$A),
 
146
    ?line Str2 = lists:duplicate(65536,$A),
 
147
    ?line {term,Str1} = get_term(P),
 
148
    ?line {term,Str2} = get_term(P),
 
149
 
 
150
    ?line runner:recv_eot(P),
 
151
    ok.
 
152
 
 
153
 
 
154
format_wo_ver(suite) -> [];
 
155
format_wo_ver(Config) when is_list(Config) ->
 
156
    ?line P = runner:start(?format_wo_ver),
 
157
 
 
158
    ?line {term, [{a, "b"}, {c, 10}]} = get_term(P),
 
159
 
 
160
    ?line runner:recv_eot(P),
 
161
    ok.