PageRenderTime 15ms CodeModel.GetById 12ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/test/lib/numeric/number/test_number71.e

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