/[eiffelstudio]/trunk/eweasel/tests/fake001/test_rev1.e
ViewVC logotype

Contents of /trunk/eweasel/tests/fake001/test_rev1.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 65297 - (show annotations)
Thu Nov 30 20:22:33 2006 UTC (13 years ago) by manus
File size: 1193 byte(s)
Moved from trunk/Src/eweasel to trunk/eweasel so that a simple checkout of the source code is not penalized by the lenghty process of checking out all the tests of eweasel.
1
2 --| Copyright (c) 1993-2006 University of Southern California and contributors.
3 --| All rights reserved.
4 --| Your use of this work is governed under the terms of the GNU General
5 --| Public License version 2.
6
7 class TEST
8
9 inherit
10 ARGUMENTS
11 creation
12 make
13 feature
14
15 make is
16 local
17 s: STRING;
18 k, count: INTEGER;
19 do
20 count := argument (1).to_integer;
21 !!s.make (20);
22 s.append ("turkey");
23 from
24 k := 1;
25 until
26 k > count
27 loop
28 io.putstring (concat (
29 << "Hey there ", int_to_string (k), "%N" >>));
30 k := k + 1;
31 end
32 end;
33
34 animal: STRING is "weasel";
35
36 concat (list: ARRAY [STRING]): STRING is
37 local
38 k, total_len: INTEGER;
39 do
40 from
41 k := list.lower;
42 until
43 k > list.upper
44 loop
45 total_len := total_len + list.item (k).count;
46 k := k + 1;
47 end;
48
49 !!Result.make (total_len);
50 from
51 k := list.lower;
52 until
53 k > list.upper
54 loop
55 Result.append (list.item (k));
56 k := k + 1;
57 end
58 end;
59
60 int_to_string (n: INTEGER): STRING is
61 do
62 !!Result.make (13);
63 Result.append_integer (n);
64 end;
65
66 double_to_string (n: DOUBLE): STRING is
67 do
68 !!Result.make (13);
69 Result.append_double (n);
70 end
71 end
72

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23