mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 21:05:39 +02:00
Add test for empty result of filter generator
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <catch2/generators/catch_generators_adapters.hpp>
|
||||
#include <catch2/generators/catch_generators_random.hpp>
|
||||
#include <catch2/generators/catch_generators_range.hpp>
|
||||
#include <catch2/generators/catch_generator_exception.hpp>
|
||||
|
||||
// Tests of generator implementation details
|
||||
TEST_CASE("Generators internals", "[generators][internals]") {
|
||||
@@ -534,3 +535,12 @@ TEST_CASE( "Random generators can be seeded", "[generators][approvals]" ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("Filter generator throws exception for empty generator",
|
||||
"[generators]") {
|
||||
using namespace Catch::Generators;
|
||||
|
||||
REQUIRE_THROWS_AS(
|
||||
filter( []( int ) { return false; }, value( 3 ) ),
|
||||
Catch::GeneratorException );
|
||||
}
|
||||
|
Reference in New Issue
Block a user