mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-03 13:55:39 +02:00
Convert examples to piecemeal includes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user