libcruft-util/test/iterator.cpp
Danny Robson 34788756d2 build: don't use './' as an include prefix
GCC produces ODR error when including paths of the form './foo' and
'foo' in the same binary. Rather than managing duplication we just
universally pick the absolute form over the relative form.
2017-11-22 16:49:37 +11:00

26 lines
573 B
C++

#include "../tap.hpp"
#include "../iterator.hpp"
#include <vector>
#include <array>
///////////////////////////////////////////////////////////////////////////////
int
main (int, char**)
{
util::TAP::logger tap;
std::vector<int> v_int { 1, 2, 3 };
std::array<float,3> a_float { 1.1f, 2.2f, 3.3f };
bool success = true;
for (auto [i, v, a]: util::izip (v_int, a_float)) {
success = success && v_int[i] == v && util::exactly_equal (a_float[i], a);
}
tap.expect (success, "izip tuples of int and float");
return tap.status ();
}