Add Base::Tools::escapeQuotesFromString with corresponding test
To be used to avoid sending unescaped quotes to python console
This commit is contained in:
committed by
Chris Hennes
parent
f34861c99b
commit
808e5d9d74
@@ -145,4 +145,10 @@ TEST(BaseToolsSuite, TestJoinList)
|
||||
{
|
||||
EXPECT_EQ(Base::Tools::joinList({"AB", "CD"}), "AB, CD, ");
|
||||
}
|
||||
TEST(BaseToolsSuite, TestEscapeQuotesFromString)
|
||||
{
|
||||
EXPECT_EQ(Base::Tools::escapeQuotesFromString("\'"), "\\\'");
|
||||
EXPECT_EQ(Base::Tools::escapeQuotesFromString("\""), "\\\"");
|
||||
EXPECT_EQ(Base::Tools::escapeQuotesFromString("\\"), "\\");
|
||||
}
|
||||
// NOLINTEND(cppcoreguidelines-*,readability-*)
|
||||
|
||||
Reference in New Issue
Block a user