12 #ifndef TESSERACT_UNITTEST_NORMSTRNGS_TEST_H_
13 #define TESSERACT_UNITTEST_NORMSTRNGS_TEST_H_
18 #include "absl/strings/str_cat.h"
19 #include "absl/strings/str_join.h"
25 std::stringstream result;
26 int total_chars = str32.size();
28 for (
int i = 0; i < total_chars; ++i) {
29 result <<
"[" << str32[i] <<
"]";
41 for (
const auto& s : glyphs) {
49 int unicode_count,
int glyph_count,
52 std::vector<std::string> glyphs;
55 str.c_str(), &glyphs));
56 EXPECT_EQ(glyphs.size(), unicode_count)
58 EXPECT_EQ(target_str, absl::StrJoin(glyphs.begin(), glyphs.end(),
""));
61 str.c_str(), &glyphs));
62 EXPECT_EQ(glyphs.size(), glyph_count)
64 EXPECT_EQ(target_str, absl::StrJoin(glyphs.begin(), glyphs.end(),
""));
67 str.c_str(), &glyphs));
68 EXPECT_EQ(glyphs.size(), grapheme_count)
70 EXPECT_EQ(target_str, absl::StrJoin(glyphs.begin(), glyphs.end(),
""));
73 true, str.c_str(), &glyphs));
75 EXPECT_EQ(target_str, glyphs[0]);
79 EXPECT_EQ(target_str, result);
84 #endif // TESSERACT_UNITTEST_NORMSTRNGS_TEST_H_