Convert examples to piecemeal includes

This commit is contained in:
Martin Hořeňovský 2020-01-21 14:46:07 +01:00
parent 26f78f96aa
commit 17281c09c3
No known key found for this signature in database
GPG key ID: DE48307B8B0D381A
8 changed files with 22 additions and 13 deletions

View file

@ -1,9 +1,9 @@
// 301-Gen-MapTypeConversion.cpp
// Shows how to use map to modify generator's return type.
// TODO
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_generators_generic.hpp>
#include <string>
#include <sstream>
@ -23,7 +23,7 @@ public:
}
std::string const& get() const override;
bool next() override {
return !!std::getline(m_stream, m_line);
}
@ -49,7 +49,7 @@ Catch::Generators::GeneratorWrapper<std::string> lines(std::string /* ignored fo
TEST_CASE("filter can convert types inside the generator expression", "[example][generator]") {
auto num = GENERATE(map<int>([](std::string const& line) { return std::stoi(line); },
lines("fake-file")));
REQUIRE(num > 0);
}