PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/test/language/agent/test_agent32.e

http://github.com/tybor/Liberty
Specman e | 61 lines | 30 code | 8 blank | 23 comment | 0 complexity | 8b3c10f8629d54678e04b67254967e4e 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_AGENT32
 5
 6inherit
 7   EIFFELTEST_TOOLS
 8      --SZ:114: the compiler gets confused. It consider bar return
 9      --type being the return type of foo!
10
11create {}
12   make
13
14feature {ANY}
15   make
16      local
17         b: BOOLEAN; i: INTEGER
18      do
19         bar := agent is_greater_than_5(?)
20         b := bar.item([{INTEGER_32 6}])
21         assert(b)
22         foo := Void
23         assert(foo = Void)
24         foo := agent five
25         i := foo.item([])
26         assert(i = 5)
27      end
28
29   is_greater_than_5 (i: INTEGER): BOOLEAN
30      do
31         Result := i > 5
32      end
33
34   bar: PREDICATE[TUPLE[INTEGER]]
35
36   five: INTEGER
37      do
38         Result := 5
39      end
40
41   foo: FUNCTION[TUPLE, INTEGER]
42
43end -- class TEST_AGENT32
44--
45-- ------------------------------------------------------------------------------------------------------------------------------
46-- Copyright notice below. Please read.
47--
48-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
49-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
50-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
51-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
52-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
53-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
54--
55-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
56-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
57--
58-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
59--
60-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
61-- ------------------------------------------------------------------------------------------------------------------------------