PageRenderTime 13ms CodeModel.GetById 6ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/test/language/unclassified/aux_inherit_string1.e

http://github.com/tybor/Liberty
Specman e | 75 lines | 47 code | 6 blank | 22 comment | 1 complexity | e2de217dc80f516f4c6354fd57484e67 MD5 | raw file
 1-- This file is part of SmartEiffel The GNU Eiffel Compiler Tools and Libraries.
 2-- See the Copyright notice at the end of this file.
 3--
 4class AUX_INHERIT_STRING1
 5
 6inherit
 7   STRING
 8      rename make as string_make
 9      end
10
11create {ANY}
12   make, copy, string_make
13
14feature {ANY}
15   make (init: STRING)
16      local
17         i: INTEGER
18      do
19         string_make(init.count)
20         assert(capacity = init.count)
21         assert(count = 0)
22         from
23            i := 1
24         until
25            i > init.count
26         loop
27            extend(init.item(i))
28            i := i + 1
29         end
30         assert(not is_empty)
31         assert(count = 3)
32         assert(init.count = count)
33         from
34            i := count
35         until
36            i = 0
37         loop
38            assert(init.item(i) = item(i))
39            i := i - 1
40         end
41      end
42
43   assert (b: BOOLEAN)
44      do
45         cpt := cpt + 1
46         if not b then
47            std_output.put_string("TEST_INHERIT_STRING1: ERROR Test # ")
48            std_output.put_integer(cpt)
49            std_output.put_string("%N")
50         else
51            -- std_output.put_string("Yes%N")
52         end
53      end
54
55   cpt: INTEGER
56
57end -- class AUX_INHERIT_STRING1
58--
59-- ------------------------------------------------------------------------------------------------------------------------------
60-- Copyright notice below. Please read.
61--
62-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
63-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
64-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
65-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
66-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
67-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
68--
69-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
70-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
71--
72-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
73--
74-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
75-- ------------------------------------------------------------------------------------------------------------------------------