mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 21:05:39 +02:00
Improve error handling in parsing reporter specs
This commit is contained in:
@@ -682,3 +682,20 @@ TEST_CASE("Test with special, characters \"in name", "[cli][regression]") {
|
||||
// This test case succeeds if we can invoke it from the CLI
|
||||
SUCCEED();
|
||||
}
|
||||
|
||||
TEST_CASE("Various suspicious reporter specs are rejected",
|
||||
"[cli][reporter-spec][approvals]") {
|
||||
Catch::ConfigData config;
|
||||
auto cli = Catch::makeCommandLineParser( config );
|
||||
|
||||
auto spec = GENERATE( as<std::string>{},
|
||||
"",
|
||||
"::console",
|
||||
"console::",
|
||||
"console::some-file::",
|
||||
"::console::some-file::" );
|
||||
CAPTURE( spec );
|
||||
|
||||
auto result = cli.parse( { "test", "--reporter", spec } );
|
||||
REQUIRE_FALSE( result );
|
||||
}
|
||||
|
Reference in New Issue
Block a user