diff options
| author | Martin Hořeňovský | 2021-12-30 23:50:40 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2022-01-01 14:16:11 +0100 |
| commit | fae0be25b3e1bdd07a18465749488650616d78f9 (patch) | |
| tree | f0fd7d41d82bac9ee38f095cab0193f35ec13ace /tests | |
| parent | 899554bff2ba64afa7a20e1796b85d396cbbfd8d (diff) | |
| download | catch3-fae0be25b3e1bdd07a18465749488650616d78f9.tar.gz | |
Improve error handling in parsing reporter specs
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp b/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp index 2210a3a4..53fc08b8 100644 --- a/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp +++ b/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp @@ -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 ); +} |