/test/language/unclassified/test_standard_clone.e
Specman e | 66 lines | 36 code | 9 blank | 21 comment | 0 complexity | 91371859ad7f2470ee897ba34f423640 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_STANDARD_CLONE 5 6insert 7 EIFFELTEST_TOOLS 8 9create {} 10 make 11 12feature {ANY} 13 s1, s2: STRING 14 15 a1, a2: ANIMAL 16 17 ai1, ai2: ARRAY[INTEGER] 18 19 p1, p2: LIB_TEST_POINT 20 21 t1, t2: TRIANGLE 22 23 make 24 do 25 s1 := "foo" 26 s2 := s1.standard_twin 27 assert(s1 /= s2) 28 assert(s1.standard_is_equal(s2)) 29 assert(s1.is_equal(s2)) 30 create {CAT} a1 31 a2 := a1.standard_twin 32 assert(a1 /= a2) 33 assert(a1.is_equal(a2)) 34 assert(a1.standard_is_equal(a2)) 35 ai1 := {ARRAY[INTEGER] 1, << 1, 2, 3 >> } 36 ai2 := ai1.standard_twin 37 assert(ai1.is_equal(ai2)) 38 assert(ai1.standard_is_equal(ai2)) 39 assert(ai1 /= ai2) 40 create p1.make(1, 2) 41 p2 := p1.standard_twin 42 assert(p1 /= p2) 43 assert(p1.x = p2.x) 44 assert(p1.y = p2.y) 45 assert(p1.same_dynamic_type(p2)) 46 end 47 48end -- class TEST_STANDARD_CLONE 49-- 50-- ------------------------------------------------------------------------------------------------------------------------------ 51-- Copyright notice below. Please read. 52-- 53-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, 54-- as published by the Free Software Foundation; either version 2, or (at your option) any later version. 55-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty 56-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have 57-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free 58-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 59-- 60-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE 61-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE 62-- 63-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN 64-- 65-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr 66-- ------------------------------------------------------------------------------------------------------------------------------