diff options
| author | Martin Hořeňovský | 2019-07-01 18:07:37 +0200 |
|---|---|---|
| committer | GitHub | 2019-07-01 18:07:37 +0200 |
| commit | c0d3a2e08f187a5a59ab097cb158487d2590796c (patch) | |
| tree | 5f7e4439a11c5c76110b4fcaeb6151e14611dda8 /projects/SelfTest/UsageTests/Generators.tests.cpp | |
| parent | 2c3018a9d5d7c68568a4d804825e7c5f95f41f6a (diff) | |
| parent | 9cf5897a11154bab4d561c80ab66ef33ecc91838 (diff) | |
| download | catch3-c0d3a2e08f187a5a59ab097cb158487d2590796c.tar.gz | |
Merge pull request #1672 from sommd/master
Fix ChunkGenerator with chunk-size 0
Diffstat (limited to 'projects/SelfTest/UsageTests/Generators.tests.cpp')
| -rw-r--r-- | projects/SelfTest/UsageTests/Generators.tests.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/projects/SelfTest/UsageTests/Generators.tests.cpp b/projects/SelfTest/UsageTests/Generators.tests.cpp index f5e3f6a5..903f6a03 100644 --- a/projects/SelfTest/UsageTests/Generators.tests.cpp +++ b/projects/SelfTest/UsageTests/Generators.tests.cpp @@ -167,6 +167,10 @@ TEST_CASE("Generators -- adapters", "[generators][generic]") { REQUIRE(chunk2.front() == chunk2.back()); REQUIRE(chunk2.front() < 3); } + SECTION("Chunk size of zero") { + auto chunk2 = GENERATE(take(3, chunk(0, value(1)))); + REQUIRE(chunk2.size() == 0); + } SECTION("Throws on too small generators") { using namespace Catch::Generators; REQUIRE_THROWS_AS(chunk(2, value(1)), Catch::GeneratorException); |