14 #define EXPECT_CASEMAPPING_CODEPOINT_NUL_EQ(_codepoint, _name) { \
15 ::helpers::CaseMappingEntry e; \
16 e.codepoint = _codepoint; \
17 e.lowercase = std::string(1, '\0'); \
18 e.uppercase = std::string(1, '\0'); \
19 e.titlecase = std::string(1, '\0'); \
21 ::helpers::CaseMappingEntry a; \
22 std::string text = ::helpers::utf8(_codepoint); \
23 a.lowercase = ::helpers::lowercase(text); \
24 a.uppercase = ::helpers::uppercase(text); \
25 a.titlecase = ::helpers::titlecase(text); \
26 EXPECT_PRED_FORMAT2(::helpers::CompareCodepoint, e, a); \
29 #define EXPECT_CASEMAPPING_CODEPOINT_EQ(_codepoint, _lowercase, _uppercase, _titlecase, _name) { \
30 ::helpers::CaseMappingEntry e; \
31 e.codepoint = _codepoint; \
32 e.lowercase = _lowercase; \
33 e.uppercase = _uppercase; \
34 e.titlecase = _titlecase; \
36 ::helpers::CaseMappingEntry a; \
37 std::string text = ::helpers::utf8(_codepoint); \
38 a.lowercase = ::helpers::lowercase(text); \
39 a.uppercase = ::helpers::uppercase(text); \
40 a.titlecase = ::helpers::titlecase(text); \
41 EXPECT_PRED_FORMAT2(::helpers::CompareCodepoint, e, a); \
44 #define EXPECT_CASEMAPPING_EQ(_input, _lowercase, _uppercase, _titlecase) { \
45 ::helpers::CaseMappingEntry e; \
46 e.lowercase = _lowercase; \
47 e.uppercase = _uppercase; \
48 e.titlecase = _titlecase; \
49 ::helpers::CaseMappingEntry a; \
51 a.lowercase = ::helpers::lowercase(_input); \
52 a.uppercase = ::helpers::uppercase(_input); \
53 a.titlecase = ::helpers::titlecase(_input); \
54 EXPECT_PRED_FORMAT2(::helpers::CompareCaseMapping, e, a); \
57 #if UTF8_VERSION_GUARD(1, 4, 0)
58 #define EXPECT_CASEFOLDING_EQ(_codepoint, _folded, _name) { \
59 ::helpers::CaseFoldingEntry e; \
60 e.codePoint = _codepoint; \
63 ::helpers::CaseFoldingEntry a; \
64 a.folded = ::helpers::casefold(::helpers::utf8(_codepoint)); \
65 EXPECT_PRED_FORMAT2(::helpers::CompareCaseFolding, e, a); \
71 std::string uppercase(
const std::string& text);
73 std::string lowercase(
const std::string& text);
75 std::string titlecase(
const std::string& text);
77 #if UTF8_VERSION_GUARD(1, 4, 0)
78 std::string casefold(
const std::string& text);
81 struct CaseMappingEntry
91 std::string lowercase;
92 std::string uppercase;
93 std::string titlecase;
96 ::testing::AssertionResult CompareCodepoint(
97 const char* expressionExpected,
const char* expressionActual,
98 const CaseMappingEntry& entryExpected,
const CaseMappingEntry& entryActual);
100 ::testing::AssertionResult CompareCaseMapping(
101 const char* expressionExpected,
const char* expressionActual,
102 const CaseMappingEntry& entryExpected,
const CaseMappingEntry& entryActual);
104 #if UTF8_VERSION_GUARD(1, 4, 0)
105 struct CaseFoldingEntry
112 ::testing::AssertionResult CompareCaseFolding(
113 const char* expressionExpected,
const char* expressionActual,
114 const CaseFoldingEntry& entryExpected,
const CaseFoldingEntry& entryActual);
uint32_t unicode_t
UTF-32 encoded code point.
Definition: utf8rewind.h:203
Base includes for helper methods.