Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(678)

Unified Diff: test/unittests/unicode/unicode-predicates-unittest.cc

Issue 640193002: Allow identifier code points from supplementary multilingual planes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/unittests/unicode/unicode-predicates-unittest.cc
diff --git a/test/unittests/unicode/unicode-predicates-unittest.cc b/test/unittests/unicode/unicode-predicates-unittest.cc
index 88008d55bd22e81d33781c39ffe71b070fffe4e9..71f20d28733f72ef790e60b9ada12004b1bd89a8 100644
--- a/test/unittests/unicode/unicode-predicates-unittest.cc
+++ b/test/unittests/unicode/unicode-predicates-unittest.cc
@@ -86,5 +86,36 @@ TEST(UnicodePredicatesTest, IdentifierPart) {
EXPECT_FALSE(IdentifierPart::Is(0x2E2F));
}
+
+#ifdef V8_I18N_SUPPORT
+TEST(UnicodePredicatesTest, SupplementaryPlaneIdentifiers) {
+ // Both ID_Start and ID_Continue.
+ EXPECT_TRUE(IdentifierStart::Is(0x10403)); // Category Lu
+ EXPECT_TRUE(IdentifierPart::Is(0x10403));
+ EXPECT_TRUE(IdentifierStart::Is(0x1043C)); // Category Ll
+ EXPECT_TRUE(IdentifierPart::Is(0x1043C));
+ EXPECT_TRUE(IdentifierStart::Is(0x16F9C)); // Category Lm
+ EXPECT_TRUE(IdentifierPart::Is(0x16F9C));
+ EXPECT_TRUE(IdentifierStart::Is(0x10048)); // Category Lo
+ EXPECT_TRUE(IdentifierPart::Is(0x10048));
+ EXPECT_TRUE(IdentifierStart::Is(0x1014D)); // Category Nl
+ EXPECT_TRUE(IdentifierPart::Is(0x1014D));
+
+ // Only ID_Continue.
+ EXPECT_FALSE(IdentifierStart::Is(0x101FD)); // Category Mn
+ EXPECT_TRUE(IdentifierPart::Is(0x101FD));
+ EXPECT_FALSE(IdentifierStart::Is(0x11002)); // Category Mc
+ EXPECT_TRUE(IdentifierPart::Is(0x11002));
+ EXPECT_FALSE(IdentifierStart::Is(0x104A9)); // Category Nd
+ EXPECT_TRUE(IdentifierPart::Is(0x104A9));
+
+ // Neither.
+ EXPECT_FALSE(IdentifierStart::Is(0x10111)); // Category No
+ EXPECT_FALSE(IdentifierPart::Is(0x10111));
+ EXPECT_FALSE(IdentifierStart::Is(0x1F4A9)); // Category So
+ EXPECT_FALSE(IdentifierPart::Is(0x1F4A9));
+}
+#endif // V8_I18N_SUPPORT
+
} // namespace internal
} // namespace v8
« src/scanner.h ('K') | « test/mjsunit/parse-surrogates.js ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698