tests: Make rows_assertions::with_rows() verify order

This commit is contained in:
Tomasz Grabiec
2015-03-26 10:20:38 +01:00
parent ef52bb6048
commit 2bc1c7b534

View File

@@ -158,11 +158,15 @@ public:
return {*this};
}
// Verifies that the result has the following rows and only that rows, in that order.
rows_assertions with_rows(std::initializer_list<std::initializer_list<bytes_opt>> rows) {
with_size(rows.size());
for (auto&& row : rows) {
with_row(row);
}
BOOST_REQUIRE(std::equal(rows.begin(), rows.end(),
_rows->rs().rows().begin(), [] (auto&& lhs, auto&& rhs) {
return std::equal(
std::begin(lhs), std::end(lhs),
std::begin(rhs), std::end(rhs));
}));
return {*this};
}
};