| 1234567891011121314151617181920212223 |
- //
- // indexed_iterator.t.h
- // iterator
- //
- // Created by Sam Jaffe on 3/5/17.
- //
- #pragma once
- #include <cxxtest/TestSuite.h>
- #include "indexed_iterator.hpp"
- class indexed_iterator_TestSuite : public CxxTest::TestSuite {
- public:
- void test_index_aligns_with_data() {
- std::vector<int> const vec{5, 3, 2, 8, 9, 11, 2, 4};
- iterator::indexed_iterator<std::vector<int>::const_iterator> it{vec.begin()}, end{vec.end()};
- for (; it != end; ++it) {
- TS_ASSERT_EQUALS((*it).second, vec[(*it).first]);
- }
- }
- };
|