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

/test/language/unclassified/test_or1.e

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