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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « source/test/intltest/ucdtest.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /******************************************************************** 1 /********************************************************************
2 * COPYRIGHT: 2 * Copyright (c) 1997-2016, International Business Machines Corporation and
3 * Copyright (c) 1997-2014, International Business Machines Corporation and
4 * others. All Rights Reserved. 3 * others. All Rights Reserved.
5 ********************************************************************/ 4 ********************************************************************/
6 5
7 #include "unicode/ustring.h" 6 #include "unicode/ustring.h"
8 #include "unicode/uchar.h" 7 #include "unicode/uchar.h"
9 #include "unicode/uniset.h" 8 #include "unicode/uniset.h"
10 #include "unicode/putil.h" 9 #include "unicode/putil.h"
11 #include "unicode/uscript.h" 10 #include "unicode/uscript.h"
12 #include "cstring.h" 11 #include "cstring.h"
13 #include "hash.h" 12 #include "hash.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 if(exec) { 52 if(exec) {
54 logln("TestSuite UnicodeTest: "); 53 logln("TestSuite UnicodeTest: ");
55 } 54 }
56 TESTCASE_AUTO_BEGIN; 55 TESTCASE_AUTO_BEGIN;
57 TESTCASE_AUTO(TestAdditionalProperties); 56 TESTCASE_AUTO(TestAdditionalProperties);
58 TESTCASE_AUTO(TestBinaryValues); 57 TESTCASE_AUTO(TestBinaryValues);
59 TESTCASE_AUTO(TestConsistency); 58 TESTCASE_AUTO(TestConsistency);
60 TESTCASE_AUTO(TestPatternProperties); 59 TESTCASE_AUTO(TestPatternProperties);
61 TESTCASE_AUTO(TestScriptMetadata); 60 TESTCASE_AUTO(TestScriptMetadata);
62 TESTCASE_AUTO(TestBidiPairedBracketType); 61 TESTCASE_AUTO(TestBidiPairedBracketType);
62 TESTCASE_AUTO(TestEmojiProperties);
63 TESTCASE_AUTO_END; 63 TESTCASE_AUTO_END;
64 } 64 }
65 65
66 //==================================================== 66 //====================================================
67 // private data used by the tests 67 // private data used by the tests
68 //==================================================== 68 //====================================================
69 69
70 // test DerivedCoreProperties.txt ------------------------------------------- 70 // test DerivedCoreProperties.txt -------------------------------------------
71 71
72 // copied from genprops.c 72 // copied from genprops.c
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 assertTrue("bpt!=None is a subset of Bidi_M", mirrored.containsAll(bpt)); 500 assertTrue("bpt!=None is a subset of Bidi_M", mirrored.containsAll(bpt));
501 assertTrue("bpt!=None is a subset of bc=ON", other_neutral.containsAll(bpt)) ; 501 assertTrue("bpt!=None is a subset of bc=ON", other_neutral.containsAll(bpt)) ;
502 // The following are true at least initially in Unicode 6.3. 502 // The following are true at least initially in Unicode 6.3.
503 UnicodeSet bpt_open("[:bpt=o:]", errorCode); 503 UnicodeSet bpt_open("[:bpt=o:]", errorCode);
504 UnicodeSet bpt_close("[:bpt=c:]", errorCode); 504 UnicodeSet bpt_close("[:bpt=c:]", errorCode);
505 UnicodeSet ps("[:Ps:]", errorCode); 505 UnicodeSet ps("[:Ps:]", errorCode);
506 UnicodeSet pe("[:Pe:]", errorCode); 506 UnicodeSet pe("[:Pe:]", errorCode);
507 assertTrue("bpt=Open is a subset of Ps", ps.containsAll(bpt_open)); 507 assertTrue("bpt=Open is a subset of Ps", ps.containsAll(bpt_open));
508 assertTrue("bpt=Close is a subset of Pe", pe.containsAll(bpt_close)); 508 assertTrue("bpt=Close is a subset of Pe", pe.containsAll(bpt_close));
509 } 509 }
510
511 void UnicodeTest::TestEmojiProperties() {
512 assertFalse("space is not Emoji", u_hasBinaryProperty(0x20, UCHAR_EMOJI));
513 assertTrue("shooting star is Emoji", u_hasBinaryProperty(0x1F320, UCHAR_EMOJ I));
514 IcuTestErrorCode errorCode(*this, "TestEmojiProperties()");
515 UnicodeSet emoji("[:Emoji:]", errorCode);
516 assertTrue("lots of Emoji", emoji.size() > 700);
517
518 assertTrue("shooting star is Emoji_Presentation",
519 u_hasBinaryProperty(0x1F320, UCHAR_EMOJI_PRESENTATION));
520 assertTrue("Fitzpatrick 6 is Emoji_Modifier",
521 u_hasBinaryProperty(0x1F3FF, UCHAR_EMOJI_MODIFIER));
522 assertTrue("happy person is Emoji_Modifier_Base",
523 u_hasBinaryProperty(0x1F64B, UCHAR_EMOJI_MODIFIER_BASE));
524 }
OLDNEW
« 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