| 265 | |
| 266 | template <typename K, typename V> |
| 267 | void PrintMap(const Map<K, V>& m0) { |
| 268 | std::cout << "{"; |
| 269 | for (auto it = m0.begin(); it != m0.end(); ++it) { |
| 270 | if (it != m0.begin()) { |
| 271 | std::cout << ", "; |
| 272 | } |
| 273 | std::cout << (*it).first << ": " << (*it).second; |
| 274 | } |
| 275 | std::cout << "}" << std::endl; |
| 276 | } |
| 277 | |
| 278 | TEST(Map, MapInsertOrder) { |
| 279 | // test that map preserves the insertion order |