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