[clang-tools-extra] r318793 - [clangd] use u8 strings in tests to avoid problems on windows

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 21 11:10:23 PST 2017


Author: sammccall
Date: Tue Nov 21 11:10:22 2017
New Revision: 318793

URL: http://llvm.org/viewvc/llvm-project?rev=318793&view=rev
Log:
[clangd] use u8 strings in tests to avoid problems on windows

Modified:
    clang-tools-extra/trunk/unittests/clangd/JSONExprTests.cpp

Modified: clang-tools-extra/trunk/unittests/clangd/JSONExprTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/JSONExprTests.cpp?rev=318793&r1=318792&r2=318793&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clangd/JSONExprTests.cpp (original)
+++ clang-tools-extra/trunk/unittests/clangd/JSONExprTests.cpp Tue Nov 21 11:10:22 2017
@@ -137,12 +137,12 @@ TEST(JSONTest, Parse) {
   Compare(R"("\"\\\b\f\n\r\t")", "\"\\\b\f\n\r\t");
   Compare(R"("\u0000")", llvm::StringRef("\0", 1));
   Compare("\"\x7f\"", "\x7f");
-  Compare(R"("\ud801\udc37")", "\U00010437"); // UTF16 surrogate pair escape.
-  Compare("\"\xE2\x82\xAC\xF0\x9D\x84\x9E\"", "\u20ac\U0001d11e"); // UTF8
+  Compare(R"("\ud801\udc37")", u8"\U00010437"); // UTF16 surrogate pair escape.
+  Compare("\"\xE2\x82\xAC\xF0\x9D\x84\x9E\"", u8"\u20ac\U0001d11e"); // UTF8
   Compare(
       R"("LoneLeading=\ud801, LoneTrailing=\udc01, LeadingLeadingTrailing=\ud801\ud801\udc37")",
-      "LoneLeading=\ufffd, LoneTrailing=\ufffd, "
-      "LeadingLeadingTrailing=\ufffd\U00010437"); // Invalid unicode.
+      u8"LoneLeading=\ufffd, LoneTrailing=\ufffd, "
+      u8"LeadingLeadingTrailing=\ufffd\U00010437"); // Invalid unicode.
 
   Compare(R"({"":0,"":0})", obj{{"", 0}});
   Compare(R"({"obj":{},"arr":[]})", obj{{"obj", obj{}}, {"arr", {}}});




More information about the cfe-commits mailing list