mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 21:05:39 +02:00
Split out colour mode string parsing into its own function
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <catch2/internal/catch_reporter_spec_parser.hpp>
|
||||
#include <catch2/matchers/catch_matchers_vector.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_config.hpp>
|
||||
|
||||
TEST_CASE("Reporter spec splitting", "[reporter-spec][cli][approvals]") {
|
||||
using Catch::Detail::splitReporterSpec;
|
||||
@@ -44,3 +45,20 @@ TEST_CASE("Reporter spec splitting", "[reporter-spec][cli][approvals]") {
|
||||
"key:key=value:value"s } ) );
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE( "Parsing colour mode", "[cli][colour][approvals]" ) {
|
||||
using Catch::Detail::stringToColourMode;
|
||||
using Catch::ColourMode;
|
||||
SECTION("Valid strings") {
|
||||
REQUIRE( stringToColourMode( "none" ) == ColourMode::None );
|
||||
REQUIRE( stringToColourMode( "ansi" ) == ColourMode::ANSI );
|
||||
REQUIRE( stringToColourMode( "win32" ) == ColourMode::Win32 );
|
||||
REQUIRE( stringToColourMode( "default" ) ==
|
||||
ColourMode::PlatformDefault );
|
||||
}
|
||||
SECTION("Wrong strings") {
|
||||
REQUIRE_FALSE( stringToColourMode( "NONE" ) );
|
||||
REQUIRE_FALSE( stringToColourMode( "-" ) );
|
||||
REQUIRE_FALSE( stringToColourMode( "asdbjsdb kasbd" ) );
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user