| 32 | } quoteTests; |
| 33 | |
| 34 | void TestQuote(const std::string& input, const std::string& expect) { |
| 35 | size_t n = input.size(); |
| 36 | auto buf = std::unique_ptr<char[]>(new char[(n + 2) * 6 + 32]); |
| 37 | char* end = Quote(input.data(), n, buf.get()); |
| 38 | *end = '\0'; |
| 39 | EXPECT_STREQ(buf.get(), expect.data()); |
| 40 | } |
| 41 | |
| 42 | TEST(Quote, Normal) { |
| 43 | std::vector<quoteTests> tests = { |