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

Unified Diff: source/test/intltest/ucdtest.cpp

Issue 1864463002: Add Emoji properties (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « source/test/intltest/ucdtest.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/test/intltest/ucdtest.cpp
diff --git a/source/test/intltest/ucdtest.cpp b/source/test/intltest/ucdtest.cpp
index a63e71291d56ba09a25fd919f907d6130b135f00..90f77ae3434ffda9ffea0234448bf9ac15dc58fc 100644
--- a/source/test/intltest/ucdtest.cpp
+++ b/source/test/intltest/ucdtest.cpp
@@ -1,6 +1,5 @@
/********************************************************************
- * COPYRIGHT:
- * Copyright (c) 1997-2014, International Business Machines Corporation and
+ * Copyright (c) 1997-2016, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
@@ -60,6 +59,7 @@ void UnicodeTest::runIndexedTest( int32_t index, UBool exec, const char* &name,
TESTCASE_AUTO(TestPatternProperties);
TESTCASE_AUTO(TestScriptMetadata);
TESTCASE_AUTO(TestBidiPairedBracketType);
+ TESTCASE_AUTO(TestEmojiProperties);
TESTCASE_AUTO_END;
}
@@ -507,3 +507,18 @@ void UnicodeTest::TestBidiPairedBracketType() {
assertTrue("bpt=Open is a subset of Ps", ps.containsAll(bpt_open));
assertTrue("bpt=Close is a subset of Pe", pe.containsAll(bpt_close));
}
+
+void UnicodeTest::TestEmojiProperties() {
+ assertFalse("space is not Emoji", u_hasBinaryProperty(0x20, UCHAR_EMOJI));
+ assertTrue("shooting star is Emoji", u_hasBinaryProperty(0x1F320, UCHAR_EMOJI));
+ IcuTestErrorCode errorCode(*this, "TestEmojiProperties()");
+ UnicodeSet emoji("[:Emoji:]", errorCode);
+ assertTrue("lots of Emoji", emoji.size() > 700);
+
+ assertTrue("shooting star is Emoji_Presentation",
+ u_hasBinaryProperty(0x1F320, UCHAR_EMOJI_PRESENTATION));
+ assertTrue("Fitzpatrick 6 is Emoji_Modifier",
+ u_hasBinaryProperty(0x1F3FF, UCHAR_EMOJI_MODIFIER));
+ assertTrue("happy person is Emoji_Modifier_Base",
+ u_hasBinaryProperty(0x1F64B, UCHAR_EMOJI_MODIFIER_BASE));
+}
« no previous file with comments | « source/test/intltest/ucdtest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698