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

/test/language/instruction/misc/test_like2.e

http://github.com/tybor/Liberty
Specman e | 70 lines | 37 code | 5 blank | 28 comment | 1 complexity | aa0411ceb83292ffb36d10d255929d30 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_LIKE2
 5
 6create {}
 7   make
 8
 9feature {ANY}
10   make
11      local
12         a: AUX_LIKE2A; b: AUX_LIKE2B; c: AUX_LIKE2C
13      do
14         create a
15         create b
16         create c
17         assert(a.f(a) = 'A')
18         assert(a.f(b) = 'B')
19         assert(a.f(c) = 'C')
20         --    assert(b.f(a) = 'A');
21         assert(b.f(b) = 'B')
22         assert(b.f(c) = 'C')
23         --    assert(c.f(a) = 'A');
24         --    assert(c.f(b) = 'B');
25         assert(c.f(c) = 'C')
26         assert(a.is_equal(a))
27         assert(not a.is_equal(b))
28         assert(not a.is_equal(c))
29         --    assert(    b.is_equal(a));
30         assert(b.is_equal(b))
31         assert(not b.is_equal(c))
32         --    assert(    c.is_equal(a));
33         --    assert(    c.is_equal(b));
34         assert(c.is_equal(c))
35      end
36
37feature {}
38   assert (b: BOOLEAN)
39      do
40         cpt := cpt + 1
41         if not b then
42            std_output.put_string("TEST_LIKE2: 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_LIKE2
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-- ------------------------------------------------------------------------------------------------------------------------------