| 49 | } |
| 50 | |
| 51 | void TestString(const std::string& unquoted) { |
| 52 | TestQuotedString(unquoted, FormatStringLiteral(unquoted)); |
| 53 | TestQuotedString(unquoted, FormatStringLiteral(absl::Cord(unquoted))); |
| 54 | if (unquoted.size() > 1) { |
| 55 | const size_t mid = unquoted.size() / 2; |
| 56 | TestQuotedString(unquoted, FormatStringLiteral(absl::MakeFragmentedCord( |
| 57 | {absl::string_view(unquoted).substr(0, mid), |
| 58 | absl::string_view(unquoted).substr(mid)}))); |
| 59 | } |
| 60 | TestQuotedString(unquoted, |
| 61 | absl::StrCat("'''", EscapeString(unquoted), "'''")); |
| 62 | TestQuotedString(unquoted, |
| 63 | absl::StrCat("\"\"\"", EscapeString(unquoted), "\"\"\"")); |
| 64 | } |
| 65 | |
| 66 | void TestRawString(const std::string& unquoted) { |
| 67 | const std::string quote = (!absl::StrContains(unquoted, "'")) ? "'" : "\""; |
no test coverage detected