PageRenderTime 20ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/test/language/unclassified/test_once9.e

http://github.com/tybor/Liberty
Specman e | 57 lines | 29 code | 5 blank | 23 comment | 3 complexity | 8a452c987d68e3735d8ca5fb90ccf608 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 TEST_ONCE9
 5   -- A bug with dynamic dispatch and the inlining of precomputed once function.
 6   -- From Guillaume Lemaitre (sz 367)
 7
 8insert
 9   ARGUMENTS
10
11create {}
12   make
13
14feature {ANY}
15   make
16      local
17         file: TEXT_FILE_READ
18      do
19         if argument_count = 1 then
20            create file.connect_to(argument(1))
21            if file.is_connected then
22               load(file)
23            end
24         end
25      end
26
27   load (p_file: INPUT_STREAM)
28      require
29         p_file.is_connected
30      do
31         p_file.read_word
32         if p_file.last_string.is_integer then
33            std_output.put_integer(p_file.last_string.to_integer)
34         else
35            std_output.put_string("Can't read an integer!%N")
36         end
37      end
38
39end -- class TEST_ONCE9
40--
41-- ------------------------------------------------------------------------------------------------------------------------------
42-- Copyright notice below. Please read.
43--
44-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
45-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
46-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
47-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
48-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
49-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
50--
51-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
52-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
53--
54-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
55--
56-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
57-- ------------------------------------------------------------------------------------------------------------------------------