Page MenuHomec4science

range_iterator.cpp
No OneTemporary

File Metadata

Created
Fri, Nov 8, 22:27

range_iterator.cpp

#include "catch.hpp"
#include "utils/range_iterator.hpp"
TEST_CASE("RangeIterator", "[iterator],[types]") {
SECTION("Simple test") {
int current = 0;
auto range = specmicp::RangeIterator<int>(0, 6);
for (auto it=range.begin(); it!=range.end(); ++it) {
CHECK(*it == current);
++current;
}
CHECK(current == 6);
current = 0;
for (auto val: specmicp::RangeIterator<int>(0, 6)) {
CHECK(val == current);
++current;
}
CHECK(current == 6);
}
}

Event Timeline