19 TEST(ValidateGraphemeTest, MultipleSyllablesAreNotASingleGrapheme) {
21 std::vector<std::string> glyphs;
24 str.c_str(), &glyphs))
27 EXPECT_EQ(glyphs.size(), 3);
33 TEST(ValidateGraphemeTest, SingleConsonantOK) {
35 std::vector<std::string> glyphs;
38 str.c_str(), &glyphs))
40 EXPECT_EQ(glyphs.size(), 1);
41 EXPECT_EQ(glyphs[0], str);
44 TEST(ValidateGraphemeTest, SimpleCV) {
46 std::vector<std::string> glyphs;
49 str.c_str(), &glyphs))
51 EXPECT_EQ(glyphs.size(), 1);
52 EXPECT_EQ(glyphs[0], str);
55 TEST(ValidateGraphemeTest, SubscriptConjunct) {
57 std::vector<std::string> glyphs;
60 str.c_str(), &glyphs))
62 EXPECT_EQ(glyphs.size(), 1);
63 EXPECT_EQ(glyphs[0], str);
66 true, str.c_str(), &glyphs))
68 EXPECT_EQ(glyphs.size(), 3);
72 TEST(ValidateGraphemeTest, HalfFormJoiner) {
74 std::vector<std::string> glyphs;
77 str.c_str(), &glyphs))
79 EXPECT_EQ(glyphs.size(), 1);
80 EXPECT_EQ(glyphs[0], str);
83 true, str.c_str(), &glyphs))
86 EXPECT_EQ(glyphs[0],
std::string(
"\u0d15\u0d4d\u200d"));
89 TEST(ValidateGraphemeTest, TraditionalConjunctJoiner) {
91 std::vector<std::string> glyphs;
94 str.c_str(), &glyphs))
96 EXPECT_EQ(glyphs.size(), 1);
97 EXPECT_EQ(glyphs[0], str);
100 true, str.c_str(), &glyphs))
102 EXPECT_EQ(glyphs.size(), 3);
106 TEST(ValidateGraphemeTest, OpenConjunctNonJoiner) {
108 std::vector<std::string> glyphs;
111 str.c_str(), &glyphs))
113 EXPECT_EQ(glyphs.size(), 1);
114 EXPECT_EQ(glyphs[0], str);
117 true, str.c_str(), &glyphs))
119 EXPECT_EQ(glyphs.size(), 3);
122 str =
"\u0c15\u200c\u0c4d\u0c24";
125 str.c_str(), &glyphs))
129 TEST(ValidateGraphemeTest, ExplicitViramaNonJoiner) {
131 std::vector<std::string> glyphs;
134 str.c_str(), &glyphs))
136 EXPECT_EQ(glyphs.size(), 2);
140 true, str.c_str(), &glyphs))
142 EXPECT_EQ(glyphs.size(), 3);
146 TEST(ValidateGraphemeTest, ThaiGraphemes) {
149 std::vector<std::string> glyphs;
152 str.c_str(), &glyphs))
154 EXPECT_EQ(glyphs.size(), 1);
155 EXPECT_EQ(glyphs[0], str);
158 true, str.c_str(), &glyphs))
160 EXPECT_EQ(glyphs.size(), 3);
164 TEST(ValidateGraphemeTest, NoLonelyJoinersQuote) {
165 std::string str =
"'\u0d24\u0d23\u0d32\u0d4d'\u200d";
166 std::vector<std::string> glyphs;
170 str.c_str(), &glyphs))
172 EXPECT_EQ(glyphs.size(), 5);
176 EXPECT_EQ(glyphs[3],
std::string(
"\u0d32\u0d4d\u200c"));