diff options
Diffstat (limited to 'absl/strings/escaping_test.cc')
-rw-r--r-- | absl/strings/escaping_test.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/absl/strings/escaping_test.cc b/absl/strings/escaping_test.cc index ecac9ca8c588..982989b8b4a4 100644 --- a/absl/strings/escaping_test.cc +++ b/absl/strings/escaping_test.cc @@ -160,11 +160,14 @@ TEST(Unescape, BasicFunction) { EXPECT_EQ(out, val.unescaped); } std::string bad[] = - {"\\u1", // too short - "\\U1", // too short - "\\Uffffff", - "\\777", // exceeds 0xff - "\\xABCD"}; // exceeds 0xff + {"\\u1", // too short + "\\U1", // too short + "\\Uffffff", // exceeds 0x10ffff (largest Unicode) + "\\U00110000", // exceeds 0x10ffff (largest Unicode) + "\\uD835", // surrogate character (D800-DFFF) + "\\U0000DD04", // surrogate character (D800-DFFF) + "\\777", // exceeds 0xff + "\\xABCD"}; // exceeds 0xff for (const std::string& e : bad) { std::string error; std::string out; |