Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Hořeňovský2023-02-01 18:27:41 +0100
committerMartin Hořeňovský2023-02-01 18:27:41 +0100
commit42d9d4533e8583506463ab1e688add6542b15ad4 (patch)
treef2801bffebe29188f883d676039126d0f63985e0
parent618d44c4482d99dca5515e83ad6a06b5fa49f175 (diff)
downloadcatch3-42d9d4533e8583506463ab1e688add6542b15ad4.tar.gz
Add test for empty result of filter generator
-rw-r--r--tests/SelfTest/Baselines/automake.sw.approved.txt1
-rw-r--r--tests/SelfTest/Baselines/automake.sw.multi.approved.txt1
-rw-r--r--tests/SelfTest/Baselines/compact.sw.approved.txt5
-rw-r--r--tests/SelfTest/Baselines/compact.sw.multi.approved.txt5
-rw-r--r--tests/SelfTest/Baselines/console.std.approved.txt4
-rw-r--r--tests/SelfTest/Baselines/console.sw.approved.txt13
-rw-r--r--tests/SelfTest/Baselines/console.sw.multi.approved.txt13
-rw-r--r--tests/SelfTest/Baselines/junit.sw.approved.txt3
-rw-r--r--tests/SelfTest/Baselines/junit.sw.multi.approved.txt3
-rw-r--r--tests/SelfTest/Baselines/sonarqube.sw.approved.txt1
-rw-r--r--tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt1
-rw-r--r--tests/SelfTest/Baselines/tap.sw.approved.txt4
-rw-r--r--tests/SelfTest/Baselines/tap.sw.multi.approved.txt4
-rw-r--r--tests/SelfTest/Baselines/teamcity.sw.approved.txt2
-rw-r--r--tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt2
-rw-r--r--tests/SelfTest/Baselines/xml.sw.approved.txt15
-rw-r--r--tests/SelfTest/Baselines/xml.sw.multi.approved.txt15
-rw-r--r--tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp10
18 files changed, 84 insertions, 18 deletions
diff --git a/tests/SelfTest/Baselines/automake.sw.approved.txt b/tests/SelfTest/Baselines/automake.sw.approved.txt
index 99da39c0..d33effdd 100644
--- a/tests/SelfTest/Baselines/automake.sw.approved.txt
+++ b/tests/SelfTest/Baselines/automake.sw.approved.txt
@@ -151,6 +151,7 @@ Nor would this
:test-result: FAIL FAIL does not require an argument
:test-result: FAIL FAIL_CHECK does not abort the test
:test-result: PASS Factorials are computed
+:test-result: PASS Filter generator throws exception for empty generator
:test-result: PASS Floating point matchers: double
:test-result: PASS Floating point matchers: float
:test-result: PASS Generators -- adapters
diff --git a/tests/SelfTest/Baselines/automake.sw.multi.approved.txt b/tests/SelfTest/Baselines/automake.sw.multi.approved.txt
index 56cc93ab..f698f0c5 100644
--- a/tests/SelfTest/Baselines/automake.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/automake.sw.multi.approved.txt
@@ -149,6 +149,7 @@
:test-result: FAIL FAIL does not require an argument
:test-result: FAIL FAIL_CHECK does not abort the test
:test-result: PASS Factorials are computed
+:test-result: PASS Filter generator throws exception for empty generator
:test-result: PASS Floating point matchers: double
:test-result: PASS Floating point matchers: float
:test-result: PASS Generators -- adapters
diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt
index b27b89ad..385de8ec 100644
--- a/tests/SelfTest/Baselines/compact.sw.approved.txt
+++ b/tests/SelfTest/Baselines/compact.sw.approved.txt
@@ -599,6 +599,7 @@ Misc.tests.cpp:<line number>: passed: Factorial(1) == 1 for: 1 == 1
Misc.tests.cpp:<line number>: passed: Factorial(2) == 2 for: 2 == 2
Misc.tests.cpp:<line number>: passed: Factorial(3) == 6 for: 6 == 6
Misc.tests.cpp:<line number>: passed: Factorial(10) == 3628800 for: 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>)
+GeneratorsImpl.tests.cpp:<line number>: passed: filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException
Matchers.tests.cpp:<line number>: passed: 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.1 are within 10% of each other
Matchers.tests.cpp:<line number>: passed: 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.2 are within 10% of each other
Matchers.tests.cpp:<line number>: passed: 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0 are within 99% of each other
@@ -2522,7 +2523,7 @@ InternalBenchmark.tests.cpp:<line number>: passed: med == 18. for: 18.0 == 18.0
InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0
Misc.tests.cpp:<line number>: passed:
Misc.tests.cpp:<line number>: passed:
-test cases: 408 | 308 passed | 84 failed | 5 skipped | 11 failed as expected
-assertions: 2210 | 2033 passed | 145 failed | 32 failed as expected
+test cases: 409 | 309 passed | 84 failed | 5 skipped | 11 failed as expected
+assertions: 2211 | 2034 passed | 145 failed | 32 failed as expected
diff --git a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
index 66da540e..fee9ef4d 100644
--- a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
@@ -597,6 +597,7 @@ Misc.tests.cpp:<line number>: passed: Factorial(1) == 1 for: 1 == 1
Misc.tests.cpp:<line number>: passed: Factorial(2) == 2 for: 2 == 2
Misc.tests.cpp:<line number>: passed: Factorial(3) == 6 for: 6 == 6
Misc.tests.cpp:<line number>: passed: Factorial(10) == 3628800 for: 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>)
+GeneratorsImpl.tests.cpp:<line number>: passed: filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException
Matchers.tests.cpp:<line number>: passed: 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.1 are within 10% of each other
Matchers.tests.cpp:<line number>: passed: 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.2 are within 10% of each other
Matchers.tests.cpp:<line number>: passed: 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0 are within 99% of each other
@@ -2511,7 +2512,7 @@ InternalBenchmark.tests.cpp:<line number>: passed: med == 18. for: 18.0 == 18.0
InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0
Misc.tests.cpp:<line number>: passed:
Misc.tests.cpp:<line number>: passed:
-test cases: 408 | 308 passed | 84 failed | 5 skipped | 11 failed as expected
-assertions: 2210 | 2033 passed | 145 failed | 32 failed as expected
+test cases: 409 | 309 passed | 84 failed | 5 skipped | 11 failed as expected
+assertions: 2211 | 2034 passed | 145 failed | 32 failed as expected
diff --git a/tests/SelfTest/Baselines/console.std.approved.txt b/tests/SelfTest/Baselines/console.std.approved.txt
index a2cf5119..6e8cbe3e 100644
--- a/tests/SelfTest/Baselines/console.std.approved.txt
+++ b/tests/SelfTest/Baselines/console.std.approved.txt
@@ -1533,6 +1533,6 @@ due to unexpected exception with message:
Why would you throw a std::string?
===============================================================================
-test cases: 408 | 322 passed | 69 failed | 6 skipped | 11 failed as expected
-assertions: 2193 | 2033 passed | 128 failed | 32 failed as expected
+test cases: 409 | 323 passed | 69 failed | 6 skipped | 11 failed as expected
+assertions: 2194 | 2034 passed | 128 failed | 32 failed as expected
diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt
index 84aba2a9..9a5ed7df 100644
--- a/tests/SelfTest/Baselines/console.sw.approved.txt
+++ b/tests/SelfTest/Baselines/console.sw.approved.txt
@@ -4478,6 +4478,15 @@ with expansion:
3628800 (0x<hex digits>) == 3628800 (0x<hex digits>)
-------------------------------------------------------------------------------
+Filter generator throws exception for empty generator
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_THROWS_AS( filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException )
+
+-------------------------------------------------------------------------------
Floating point matchers: double
Relative
-------------------------------------------------------------------------------
@@ -18103,6 +18112,6 @@ Misc.tests.cpp:<line number>
Misc.tests.cpp:<line number>: PASSED:
===============================================================================
-test cases: 408 | 308 passed | 84 failed | 5 skipped | 11 failed as expected
-assertions: 2210 | 2033 passed | 145 failed | 32 failed as expected
+test cases: 409 | 309 passed | 84 failed | 5 skipped | 11 failed as expected
+assertions: 2211 | 2034 passed | 145 failed | 32 failed as expected
diff --git a/tests/SelfTest/Baselines/console.sw.multi.approved.txt b/tests/SelfTest/Baselines/console.sw.multi.approved.txt
index 999cfb76..7ad6e99e 100644
--- a/tests/SelfTest/Baselines/console.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/console.sw.multi.approved.txt
@@ -4476,6 +4476,15 @@ with expansion:
3628800 (0x<hex digits>) == 3628800 (0x<hex digits>)
-------------------------------------------------------------------------------
+Filter generator throws exception for empty generator
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_THROWS_AS( filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException )
+
+-------------------------------------------------------------------------------
Floating point matchers: double
Relative
-------------------------------------------------------------------------------
@@ -18092,6 +18101,6 @@ Misc.tests.cpp:<line number>
Misc.tests.cpp:<line number>: PASSED:
===============================================================================
-test cases: 408 | 308 passed | 84 failed | 5 skipped | 11 failed as expected
-assertions: 2210 | 2033 passed | 145 failed | 32 failed as expected
+test cases: 409 | 309 passed | 84 failed | 5 skipped | 11 failed as expected
+assertions: 2211 | 2034 passed | 145 failed | 32 failed as expected
diff --git a/tests/SelfTest/Baselines/junit.sw.approved.txt b/tests/SelfTest/Baselines/junit.sw.approved.txt
index e3ab6d9b..5904bc74 100644
--- a/tests/SelfTest/Baselines/junit.sw.approved.txt
+++ b/tests/SelfTest/Baselines/junit.sw.approved.txt
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuitesloose text artifact
>
- <testsuite name="<exe-name>" errors="17" failures="128" skipped="11" tests="2221" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
+ <testsuite name="<exe-name>" errors="17" failures="128" skipped="11" tests="2222" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<properties>
<property name="random-seed" value="1"/>
<property name="filters" value="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]"/>
@@ -687,6 +687,7 @@ at Message.tests.cpp:<line number>
</failure>
</testcase>
<testcase classname="<exe-name>.global" name="Factorials are computed" time="{duration}" status="run"/>
+ <testcase classname="<exe-name>.global" name="Filter generator throws exception for empty generator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: double/Relative" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: double/Relative/Some subnormal values" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: double/Margin" time="{duration}" status="run"/>
diff --git a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt
index cbf513c4..06d8e7f5 100644
--- a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
- <testsuite name="<exe-name>" errors="17" failures="128" skipped="11" tests="2221" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
+ <testsuite name="<exe-name>" errors="17" failures="128" skipped="11" tests="2222" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<properties>
<property name="random-seed" value="1"/>
<property name="filters" value="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]"/>
@@ -686,6 +686,7 @@ at Message.tests.cpp:<line number>
</failure>
</testcase>
<testcase classname="<exe-name>.global" name="Factorials are computed" time="{duration}" status="run"/>
+ <testcase classname="<exe-name>.global" name="Filter generator throws exception for empty generator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: double/Relative" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: double/Relative/Some subnormal values" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: double/Margin" time="{duration}" status="run"/>
diff --git a/tests/SelfTest/Baselines/sonarqube.sw.approved.txt b/tests/SelfTest/Baselines/sonarqube.sw.approved.txt
index 0d16ae87..2d3de0f1 100644
--- a/tests/SelfTest/Baselines/sonarqube.sw.approved.txt
+++ b/tests/SelfTest/Baselines/sonarqube.sw.approved.txt
@@ -71,6 +71,7 @@
<testCase name="convertToBits" duration="{duration}"/>
</file>
<file path="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp">
+ <testCase name="Filter generator throws exception for empty generator" duration="{duration}"/>
<testCase name="Generators internals/Single value" duration="{duration}"/>
<testCase name="Generators internals/Preset values" duration="{duration}"/>
<testCase name="Generators internals/Generator combinator" duration="{duration}"/>
diff --git a/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt b/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt
index c261d309..b9c19190 100644
--- a/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt
@@ -70,6 +70,7 @@
<testCase name="convertToBits" duration="{duration}"/>
</file>
<file path="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp">
+ <testCase name="Filter generator throws exception for empty generator" duration="{duration}"/>
<testCase name="Generators internals/Single value" duration="{duration}"/>
<testCase name="Generators internals/Preset values" duration="{duration}"/>
<testCase name="Generators internals/Generator combinator" duration="{duration}"/>
diff --git a/tests/SelfTest/Baselines/tap.sw.approved.txt b/tests/SelfTest/Baselines/tap.sw.approved.txt
index 8719a702..59dd0384 100644
--- a/tests/SelfTest/Baselines/tap.sw.approved.txt
+++ b/tests/SelfTest/Baselines/tap.sw.approved.txt
@@ -1130,6 +1130,8 @@ ok {test-number} - Factorial(2) == 2 for: 2 == 2
ok {test-number} - Factorial(3) == 6 for: 6 == 6
# Factorials are computed
ok {test-number} - Factorial(10) == 3628800 for: 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>)
+# Filter generator throws exception for empty generator
+ok {test-number} - filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException
# Floating point matchers: double
ok {test-number} - 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.1 are within 10% of each other
# Floating point matchers: double
@@ -4445,5 +4447,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
ok {test-number} -
# xmlentitycheck
ok {test-number} -
-1..2221
+1..2222
diff --git a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt
index c671953f..63ac6fcc 100644
--- a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt
@@ -1128,6 +1128,8 @@ ok {test-number} - Factorial(2) == 2 for: 2 == 2
ok {test-number} - Factorial(3) == 6 for: 6 == 6
# Factorials are computed
ok {test-number} - Factorial(10) == 3628800 for: 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>)
+# Filter generator throws exception for empty generator
+ok {test-number} - filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException
# Floating point matchers: double
ok {test-number} - 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.1 are within 10% of each other
# Floating point matchers: double
@@ -4434,5 +4436,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
ok {test-number} -
# xmlentitycheck
ok {test-number} -
-1..2221
+1..2222
diff --git a/tests/SelfTest/Baselines/teamcity.sw.approved.txt b/tests/SelfTest/Baselines/teamcity.sw.approved.txt
index ca071ef3..8a8b55e2 100644
--- a/tests/SelfTest/Baselines/teamcity.sw.approved.txt
+++ b/tests/SelfTest/Baselines/teamcity.sw.approved.txt
@@ -370,6 +370,8 @@
##teamcity[testFinished name='FAIL_CHECK does not abort the test' duration="{duration}"]
##teamcity[testStarted name='Factorials are computed']
##teamcity[testFinished name='Factorials are computed' duration="{duration}"]
+##teamcity[testStarted name='Filter generator throws exception for empty generator']
+##teamcity[testFinished name='Filter generator throws exception for empty generator' duration="{duration}"]
##teamcity[testStarted name='Floating point matchers: double']
##teamcity[testFinished name='Floating point matchers: double' duration="{duration}"]
##teamcity[testStarted name='Floating point matchers: float']
diff --git a/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt b/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt
index d2b92ecc..77f70a63 100644
--- a/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt
@@ -370,6 +370,8 @@
##teamcity[testFinished name='FAIL_CHECK does not abort the test' duration="{duration}"]
##teamcity[testStarted name='Factorials are computed']
##teamcity[testFinished name='Factorials are computed' duration="{duration}"]
+##teamcity[testStarted name='Filter generator throws exception for empty generator']
+##teamcity[testFinished name='Filter generator throws exception for empty generator' duration="{duration}"]
##teamcity[testStarted name='Floating point matchers: double']
##teamcity[testFinished name='Floating point matchers: double' duration="{duration}"]
##teamcity[testStarted name='Floating point matchers: float']
diff --git a/tests/SelfTest/Baselines/xml.sw.approved.txt b/tests/SelfTest/Baselines/xml.sw.approved.txt
index c2beeec7..9398b897 100644
--- a/tests/SelfTest/Baselines/xml.sw.approved.txt
+++ b/tests/SelfTest/Baselines/xml.sw.approved.txt
@@ -5025,6 +5025,17 @@ C
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
+ <TestCase name="Filter generator throws exception for empty generator" tags="[generators]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+ <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+ <Original>
+ filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException
+ </Original>
+ <Expanded>
+ filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException
+ </Expanded>
+ </Expression>
+ <OverallResult success="true" skips="0"/>
+ </TestCase>
<TestCase name="Floating point matchers: double" tags="[floating-point][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Section name="Relative" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
@@ -21048,6 +21059,6 @@ b1!
</Section>
<OverallResult success="true" skips="0"/>
</TestCase>
- <OverallResults successes="2033" failures="145" expectedFailures="32" skips="11"/>
- <OverallResultsCases successes="308" failures="84" expectedFailures="11" skips="5"/>
+ <OverallResults successes="2034" failures="145" expectedFailures="32" skips="11"/>
+ <OverallResultsCases successes="309" failures="84" expectedFailures="11" skips="5"/>
</Catch2TestRun>
diff --git a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt
index a9267dee..1e5d9369 100644
--- a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt
@@ -5025,6 +5025,17 @@ C
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
+ <TestCase name="Filter generator throws exception for empty generator" tags="[generators]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+ <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+ <Original>
+ filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException
+ </Original>
+ <Expanded>
+ filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException
+ </Expanded>
+ </Expression>
+ <OverallResult success="true" skips="0"/>
+ </TestCase>
<TestCase name="Floating point matchers: double" tags="[floating-point][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Section name="Relative" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
@@ -21047,6 +21058,6 @@ b1!
</Section>
<OverallResult success="true" skips="0"/>
</TestCase>
- <OverallResults successes="2033" failures="145" expectedFailures="32" skips="11"/>
- <OverallResultsCases successes="308" failures="84" expectedFailures="11" skips="5"/>
+ <OverallResults successes="2034" failures="145" expectedFailures="32" skips="11"/>
+ <OverallResultsCases successes="309" failures="84" expectedFailures="11" skips="5"/>
</Catch2TestRun>
diff --git a/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp b/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp
index 1c203b6b..64e943f8 100644
--- a/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp
+++ b/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp
@@ -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 );
+}