Fix escaping of special chars for copyAsCString
This commit is contained in:
parent
5f2857f12a
commit
05bca069e3
2 changed files with 36 additions and 1 deletions
|
|
@ -106,3 +106,20 @@ FROM tab
|
|||
ASSERT_EQ(output, expected);
|
||||
}
|
||||
|
||||
TEST(ConvertToMultiLineCString, escapeDoubleQuote)
|
||||
{
|
||||
QString in(R"__(SELECT * FROM "table")__");
|
||||
QString expected("\"SELECT * FROM \\\"table\\\"\"");
|
||||
|
||||
auto output = ConvertToMultiLineCString(in);
|
||||
ASSERT_EQ(output, expected);
|
||||
}
|
||||
|
||||
TEST(ConvertToMultiLineCString, escapeBackslash)
|
||||
{
|
||||
QString in(R"__(SELECT '\test')__");
|
||||
QString expected(R"__("SELECT '\\test'")__");
|
||||
|
||||
auto output = ConvertToMultiLineCString(in);
|
||||
ASSERT_EQ(output, expected);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue