OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
2 // for details. all rights reserved. use of this source code is governed by a | 2 // for details. all rights reserved. use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 #include <string.h> | 5 #include <string.h> |
6 | 6 |
7 #include "src/shared/assert.h" | 7 #include "src/shared/assert.h" |
8 #include "src/shared/flags.h" | 8 #include "src/shared/flags.h" |
9 #include "src/shared/test_case.h" | 9 #include "src/shared/test_case.h" |
10 | 10 |
11 #include "src/vm/hash_map.h" | 11 #include "src/vm/hash_map.h" |
12 #include "src/vm/hash_set.h" | 12 #include "src/vm/hash_set.h" |
13 #include "src/vm/multi_hashset.h" | 13 #include "src/vm/multi_hashset.h" |
14 #include "src/vm/pair.h" | 14 #include "src/vm/pair.h" |
15 | 15 |
16 namespace fletch { | 16 namespace dartino { |
17 | 17 |
18 TEST_CASE(STRING_MAP) { | 18 TEST_CASE(STRING_MAP) { |
19 typedef HashMap<const char*, const char*> Map; | 19 typedef HashMap<const char*, const char*> Map; |
20 Map map1; | 20 Map map1; |
21 EXPECT(map1.Empty()); | 21 EXPECT(map1.Empty()); |
22 EXPECT_EQ(map1.size(), 0u); | 22 EXPECT_EQ(map1.size(), 0u); |
23 EXPECT(map1.Begin() == map1.End()); | 23 EXPECT(map1.Begin() == map1.End()); |
24 map1.Insert({"foo", "bar"}); | 24 map1.Insert({"foo", "bar"}); |
25 EXPECT_EQ(map1.size(), 1u); | 25 EXPECT_EQ(map1.size(), 1u); |
26 | 26 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 } | 287 } |
288 } | 288 } |
289 | 289 |
290 EXPECT_EQ(0u, set.size()); | 290 EXPECT_EQ(0u, set.size()); |
291 | 291 |
292 for (int j = -10; j < 10; j++) { | 292 for (int j = -10; j < 10; j++) { |
293 EXPECT_EQ(false, set.Remove(j)); | 293 EXPECT_EQ(false, set.Remove(j)); |
294 } | 294 } |
295 } | 295 } |
296 | 296 |
297 } // namespace fletch. | 297 } // namespace dartino. |
OLD | NEW |