PageRenderTime 51ms CodeModel.GetById 49ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/test/lib/storage/collection/test_is_equal_map.e

http://github.com/tybor/Liberty
Specman e | 66 lines | 40 code | 5 blank | 21 comment | 1 complexity | 2ac0aa8f703f265182b9617c4df01814 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_IS_EQUAL_MAP
 5
 6create {}
 7   make
 8
 9feature {ANY}
10   make
11      local
12         c1, c2: COLLECTION[STRING]; d1, d2: HASHED_DICTIONARY[STRING, INTEGER]
13      do
14         create d1.make
15         create d2.make
16         d1.put("foo", 1)
17         assert(not d1.is_equal(d2)) -- may also be written like "not d1~d2"
18         d2.put("foo", 1)
19         assert(d1~d2)
20         c1 := {FAST_ARRAY[STRING] << "foo", "bar" >> }
21         c2 := {FAST_ARRAY[STRING] << "foo", "bar" >> }
22         assert(c1~c2)
23         create {FAST_ARRAY[STRING]} c1.from_collection(c1)
24         create {FAST_ARRAY[STRING]} c2.from_collection(c2)
25         assert(c1~c2)
26         create {LINKED_LIST[STRING]} c1.from_collection(c1)
27         create {LINKED_LIST[STRING]} c2.from_collection(c2)
28         assert(c1~c2)
29         create {TWO_WAY_LINKED_LIST[STRING]} c1.from_collection(c1)
30         create {TWO_WAY_LINKED_LIST[STRING]} c2.from_collection(c2)
31         assert(c1~c2)
32      end
33
34feature {}
35   assert (bool: BOOLEAN)
36      do
37         cpt := cpt + 1
38         if not bool then
39            std_output.put_string("TEST_IS_EQUAL_MAP: ERROR Test # ")
40            std_output.put_integer(cpt)
41            std_output.put_string("%N")
42            crash
43         end
44      end
45
46   cpt: INTEGER
47
48end -- class TEST_IS_EQUAL_MAP
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-- ------------------------------------------------------------------------------------------------------------------------------