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

summaryrefslogtreecommitdiffhomepage
path: root/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp
diff options
context:
space:
mode:
authorLeitwolf2026-10-11 10:09:19 +0300
committerGitHub2026-10-11 10:09:19 +0300
commitce6fa1996a8e358efdcff53a7628584077d9855c (patch)
treed76f5945311828511e3ea55712487f21fbf8f70f /tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp
parent5633c5c98ec073ae938253bcfc72430d5d9aee89 (diff)
parent1f78d8903c2fb18afea8c3055f8df83d8c60d9b5 (diff)
downloadcatch3-ce6fa1996a8e358efdcff53a7628584077d9855c.tar.gz
Merge pull request #4 from Progmasoft/backport/upstream-3.16.1
Backport Catch2 3.16.1
Diffstat (limited to 'tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp')
-rw-r--r--tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp b/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp
index 4ff793f0..7abfbb7f 100644
--- a/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp
+++ b/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp
@@ -330,3 +330,17 @@ TEST_CASE("Registering multiple reporters with the same name fails",
Catch::Detail::make_unique<TestReporterFactory>() ),
"reporter using 'some-reporter-name' as name was already registered" );
}
+
+TEST_CASE( "rejectSuperfluousConfigKeys helper",
+ "[reporters][reporter-helpers][approvals]" ) {
+ using Catch::rejectSuperfluousConfigKeys; using Catch::Matchers::ContainsSubstring;
+
+ std::map<std::string, std::string> options { { "Xfoo", "1" }, { "Xbar", "2" } };
+ REQUIRE_THROWS_WITH( rejectSuperfluousConfigKeys( options, {} ),
+ ContainsSubstring( "Unknown reporter argument:" ) );
+ REQUIRE_THROWS_WITH(
+ rejectSuperfluousConfigKeys( options, { "Xfoo", "Xbaz" } ),
+ ContainsSubstring( "Unknown reporter argument: Xbar" ) );
+ REQUIRE_NOTHROW(
+ Catch::rejectSuperfluousConfigKeys( options, { "Xfoo", "Xbaz", "Xbar" } ) );
+}