mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-29 16:09:30 +00:00
Convert examples to piecemeal includes
This commit is contained in:
parent
26f78f96aa
commit
17281c09c3
8 changed files with 22 additions and 13 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue