indexed_iterator.t.h 526 B

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