PageRenderTime 19ms CodeModel.GetById 15ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/test/language/exceptions/test_exceptions04.e

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