/test/language/unclassified/test_inherit6.e
Specman e | 80 lines | 54 code | 5 blank | 21 comment | 0 complexity | 4e8f000efc79ae53c9a4ead74dc11b96 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_INHERIT6 5 6inherit 7 AUX_INHERIT6A 8 AUX_INHERIT6B 9 undefine foo2 10 end 11 EIFFELTEST_TOOLS 12 13create {} 14 make 15 16feature {ANY} 17 make 18 local 19 a: AUX_INHERIT6A; b: AUX_INHERIT6B 20 do 21 assert(count = 0) 22 foo 23 assert(count = 1) 24 bar 25 assert(count = 3) 26 assert(new_count = 0) 27 foo2 28 assert(count = 3) 29 assert(new_count = 5) 30 a := Current 31 b := Current 32 assert(count = 3) 33 a.foo 34 assert(count = 4) 35 a.bar 36 assert(count = 6) 37 assert(new_count = 5) 38 assert(a.new_count = 5) 39 a.foo2 40 assert(count = 6) 41 assert(new_count = 10) 42 assert(a.new_count = 10) 43 assert(count = 6) 44 assert(b.count = 6) 45 b.foo 46 assert(count = 7) 47 assert(b.count = 7) 48 b.bar 49 assert(b.count = 9) 50 assert(new_count = 10) 51 b.foo2 52 assert(count = 9) 53 assert(b.count = 9) 54 assert(new_count = 15) 55 end 56 57 foo 58 do 59 count := count + 1 60 end 61 62end -- class TEST_INHERIT6 63-- 64-- ------------------------------------------------------------------------------------------------------------------------------ 65-- Copyright notice below. Please read. 66-- 67-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, 68-- as published by the Free Software Foundation; either version 2, or (at your option) any later version. 69-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty 70-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have 71-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free 72-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 73-- 74-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE 75-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE 76-- 77-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN 78-- 79-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr 80-- ------------------------------------------------------------------------------------------------------------------------------