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