/[eiffelstudio]/trunk/eweasel/tests/final003/test.e
ViewVC logotype

Contents of /trunk/eweasel/tests/final003/test.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: 1109 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 creation
9 make
10
11 feature
12
13 make is
14 do
15 io.putstring (new_file_name ("Weasel")); io.new_line;
16 end;
17
18 new_file_name (pre: STRING): STRING is
19 local
20 seq: TEST1;
21 do
22 !!seq;
23 Result := concat (<< pre, "_", formatted (seq.seq_value), "_" >>);
24 end;
25
26 formatted (i : INTEGER): STRING is
27 do
28 Result := "weasel";
29 end;
30
31 concat (list: ARRAY [STRING]): STRING is
32 -- Concatenation of all the strings in `list'.
33 -- Void strings are ignored.
34 require
35 list_not_void: list /= Void
36 local
37 pos, len: INTEGER;
38 do
39 from
40 pos := list.lower;
41 until
42 pos > list.upper
43 loop
44 len := len + list.item (pos).count;
45 pos := pos + 1;
46 end;
47 from
48 !!Result.make (len);
49 pos := list.lower;
50 until
51 pos > list.upper
52 loop
53 Result.append (list.item (pos));
54 pos := pos + 1;
55 end;
56 ensure
57 result_not_void: Result /= Void;
58 end;
59 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23