| 1028 | // Verifies: elements are visited in key order |
| 1029 | template<template<typename, typename> class MapTemplate> |
| 1030 | void test_map_iteration_order() { |
| 1031 | using MapContainer = MapTemplate<int, fl::shared_ptr<int>>; |
| 1032 | |
| 1033 | MapContainer m; |
| 1034 | populate_map(m, 30, make_shared_int(3)); |
| 1035 | populate_map(m, 10, make_shared_int(1)); |
| 1036 | populate_map(m, 20, make_shared_int(2)); |
| 1037 | |
| 1038 | // Collect keys in iteration order |
| 1039 | int prev_key = -1; |
| 1040 | int last_key = -1; |
| 1041 | for (auto it = m.begin(); it != m.end(); ++it) { |
| 1042 | int current_key = it->first; |
| 1043 | bool ascending = current_key > prev_key; |
| 1044 | FL_CHECK(ascending); // Keys in ascending order |
| 1045 | prev_key = current_key; |
| 1046 | last_key = current_key; |
| 1047 | } |
| 1048 | FL_CHECK(last_key == 30); // Last key was 30 |
| 1049 | } |
| 1050 | |
| 1051 | } // namespace test_helpers |
nothing calls this directly
no test coverage detected