diff options
Diffstat (limited to 'unittests/Support/YAMLIOTest.cpp')
-rw-r--r-- | unittests/Support/YAMLIOTest.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/unittests/Support/YAMLIOTest.cpp b/unittests/Support/YAMLIOTest.cpp index 9caff85a596..650b02cdea9 100644 --- a/unittests/Support/YAMLIOTest.cpp +++ b/unittests/Support/YAMLIOTest.cpp @@ -2541,3 +2541,31 @@ TEST(YAMLIO, TestEscapedSingleQuoteInsideSingleQuote) { ostr.flush(); EXPECT_EQ("'abc''fdf'", out); } + +TEST(YAMLIO, TestEscapedUTF8SingleQuoteInsideDoubleQuote) { + std::string Id = "parameter 'параметр' is unused"; + + std::string out; + llvm::raw_string_ostream ostr(out); + Output xout(ostr, nullptr, 0); + + llvm::yaml::EmptyContext Ctx; + yamlize(xout, Id, true, Ctx); + + ostr.flush(); + EXPECT_EQ("\"parameter 'параметр' is unused\"", out); +} + +TEST(YAMLIO, TestEscapedUTF8) { + std::string Id = "/*параметр*/"; + + std::string out; + llvm::raw_string_ostream ostr(out); + Output xout(ostr, nullptr, 0); + + llvm::yaml::EmptyContext Ctx; + yamlize(xout, Id, true, Ctx); + + ostr.flush(); + EXPECT_EQ("\"/*параметр*/\"", out); +} |