/test/language/gc/test_bysl1.e
Specman e | 74 lines | 47 code | 5 blank | 22 comment | 1 complexity | de2da73cd31cc43f1d674286f7cbbb9e 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_BYSL1 5 -- From: Benjamin Yin-Sun Lynn <blynn@Stanford.EDU> 6 7create {} 8 make 9 10feature {ANY} 11 array: ARRAY[STRING] 12 once 13 Result := {ARRAY[STRING] 1, << "one", once "two", "three", "four" >> } 14 end 15 16 show 17 local 18 i: INTEGER 19 do 20 from 21 i := array.lower 22 until 23 i > array.upper 24 loop 25 io.put_string("%"" + array.item(i) + "%"%N") 26 i := i + 1 27 end 28 end 29 30 make 31 local 32 i, j: INTEGER; s: STRING 33 do 34 from 35 j := 1 36 until 37 j > 3 38 loop 39 from 40 i := 1 41 until 42 i > 100000 43 loop 44 create s.make(5) 45 i := i + 1 46 end 47 if not array.item(1).is_equal("one") then 48 io.put_string("BUG!%N") 49 show 50 die_with_code(1) 51 end 52 j := j + 1 53 end 54 end 55 56end -- class TEST_BYSL1 57-- 58-- ------------------------------------------------------------------------------------------------------------------------------ 59-- Copyright notice below. Please read. 60-- 61-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, 62-- as published by the Free Software Foundation; either version 2, or (at your option) any later version. 63-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty 64-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have 65-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free 66-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 67-- 68-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE 69-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE 70-- 71-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN 72-- 73-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr 74-- ------------------------------------------------------------------------------------------------------------------------------