PageRenderTime 24ms CodeModel.GetById 17ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/test/language/unclassified/test_infix_equal.e

http://github.com/tybor/Liberty
Specman e | 97 lines | 40 code | 5 blank | 52 comment | 1 complexity | edbb30a8fb3177db0e5edfdb51a78ae4 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_INFIX_EQUAL
 5
 6create {}
 7   make
 8
 9feature {ANY}
10   make
11      local
12         c: CHARACTER; d, d2: REAL_64; r: REAL_32; animal: ANIMAL; dog: DOG
13      do
14         -- a: ANY
15         c := 'a'
16         assert('a' = c)
17         -- *** CHARACTER does not conform to ANY (Vincent Croizier, 03/11/2004) ***
18         -- a := c
19         -- *** assert(not(a = 'a'))
20         -- Yes, it was a really bad idea to accept such code !
21         -- *** (Dom. july 12th 2004) ***
22         -- *** assert(not('a' = a))
23         -- Yes, it was a really bad idea to accept such code !
24         -- *** (Dom. july 12th 2004) ***
25         assert(88 = 88)
26         -- *** INTEGER_8 does not conform to ANY (Vincent Croizier, 03/11/2004) ***
27         -- a := 88
28         -- *** assert(not(a = 88))
29         -- Yes, it was a really bad idea to accept such code !
30         -- *** (Dom. july 12th 2004) ***
31         -- *** assert(not(88 = a))
32         -- Yes, it was a really bad idea to accept such code !
33         -- *** (Dom. july 12th 2004) ***
34         assert(88.to_real_64 = 88.0)
35         -- *** INTEGER_8 does not conform to ANY (Vincent Croizier, 03/11/2004) ***
36         -- a := 88
37         -- assert(equal(a,88))
38         -- ***  assert(not(a = 88))
39         -- Yes, it was a really bad idea to accept such code !
40         -- *** (Dom. july 12th 2004) ***
41         -- ***    assert(not(88 = a))
42         -- Yes, it was a really bad idea to accept such code !
43         -- *** (Dom. july 12th 2004) ***
44         r := {REAL_32 88.0}
45         assert(r = 88.000)
46         -- *** REAL does not conform to ANY (Vincent Croizier, 03/11/2004) ***
47         -- a := 88.0
48         assert(r = 88)
49         assert(88 = r)
50         d := 88.0
51         assert(d = 88.0)
52         assert(88.0 = d)
53         d2 := d
54         assert(d2 = 88.0)
55         assert(88.0 = d2)
56         -- *** REAL does not conform to ANY (Vincent Croizier, 03/11/2004) ***
57         -- a := d2
58         assert(d2 = 88.to_real_64)
59         assert(88.to_real_64 = d2)
60         assert(animal = dog)
61         assert(dog = animal)
62      end
63
64   assert (b: BOOLEAN)
65      do
66         cpt := cpt + 1
67         if not b then
68            sedb_breakpoint
69            std_output.put_string("TEST_INFIX_EQUAL: ERROR Test # ")
70            std_output.put_integer(cpt)
71            std_output.put_string("%N")
72         else
73            -- std_output.put_string("Yes%N")
74         end
75      end
76
77   cpt: INTEGER
78
79end -- class TEST_INFIX_EQUAL
80--
81-- ------------------------------------------------------------------------------------------------------------------------------
82-- Copyright notice below. Please read.
83--
84-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
85-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
86-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
87-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
88-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
89-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
90--
91-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
92-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
93--
94-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
95--
96-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
97-- ------------------------------------------------------------------------------------------------------------------------------