RegexUtilsTest.cpp 812 B

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