diff --git a/tests/string_test.cpp b/tests/string_test.cpp new file mode 100644 index 0000000000000..052a6014628b8 --- /dev/null +++ b/tests/string_test.cpp @@ -0,0 +1,22 @@ +#include "catch/catch.hpp" + +#include + +#include "output.h" + +static void test_remove_color_tags( const std::string &original, const std::string &expected ) +{ + CHECK( remove_color_tags( original_string ) ) == expected_string ); +} + +TEST_CASE( "string_test" ) +{ + SECTION( "Case 1 - test remove_color_tags" ) { + test_remove_color_tags( "TestString", "TestString" ); + test_remove_color_tags( "TestStringWithoutOpeningColorTagGoesHere", + "TestStringWithoutOpeningColorTagGoesHere" ); + test_remove_color_tags( "TestStringWithoutClosingColorTagGoesHere", + "TestStringWithoutClosingColorTagGoesHere" ); + test_remove_color_tags( "TestStringWithMultipleColorTagsGoesHere", + "TestStringWithMultipleColorTagsGoesHere" ); + }