RegexUtilsTest.cpp 783 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-08-18
  6. * Changed: 2020-10-29
  7. *
  8. * */
  9. #include <gtest/gtest.h>
  10. #include <ls_std/ls_std.hpp>
  11. namespace {
  12. class RegexUtilsTest : public ::testing::Test {
  13. protected:
  14. RegexUtilsTest() = default;
  15. ~RegexUtilsTest() override = default;
  16. void SetUp() override {}
  17. void TearDown() override {}
  18. };
  19. TEST_F(RegexUtilsTest, escapeString)
  20. {
  21. std::string escapedString = ls_std::RegexUtils::escapeString("Hello?!");
  22. ASSERT_STREQ(R"(Hello\?!)", escapedString.c_str());
  23. escapedString = ls_std::RegexUtils::escapeString(R"(\)");
  24. ASSERT_STREQ(R"(\\)", escapedString.c_str());
  25. }
  26. }