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