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