12 #define EXPECT_CASEMAPPING_CODEPOINT_NUL_EQ(_codepoint, _name) { \
13 ::helpers::CaseMappingEntry e; \
14 e.codepoint = _codepoint; \
15 e.lowercase = std::string(1, '\0'); \
16 e.uppercase = std::string(1, '\0'); \
17 e.titlecase = std::string(1, '\0'); \
19 ::helpers::CaseMappingEntry a; \
20 a.lowercase = ::helpers::lowercase(_codepoint); \
21 a.uppercase = ::helpers::uppercase(_codepoint); \
22 a.titlecase = ::helpers::titlecase(_codepoint); \
23 EXPECT_PRED_FORMAT2(::helpers::CompareCodepoint, e, a); \
26 #define EXPECT_CASEMAPPING_CODEPOINT_EQ(_codepoint, _lowercase, _uppercase, _titlecase, _name) { \
27 ::helpers::CaseMappingEntry e; \
28 e.codepoint = _codepoint; \
29 e.lowercase = _lowercase; \
30 e.uppercase = _uppercase; \
31 e.titlecase = _titlecase; \
33 ::helpers::CaseMappingEntry a; \
34 a.lowercase = ::helpers::lowercase(_codepoint); \
35 a.uppercase = ::helpers::uppercase(_codepoint); \
36 a.titlecase = ::helpers::titlecase(_codepoint); \
37 EXPECT_PRED_FORMAT2(::helpers::CompareCodepoint, e, a); \
40 #define EXPECT_CASEMAPPING_EQ(_input, _lowercase, _uppercase, _titlecase) { \
41 ::helpers::CaseMappingEntry e; \
42 e.lowercase = _lowercase; \
43 e.uppercase = _uppercase; \
44 e.titlecase = _titlecase; \
45 ::helpers::CaseMappingEntry a; \
47 a.lowercase = ::helpers::lowercase(_input); \
48 a.uppercase = ::helpers::uppercase(_input); \
49 a.titlecase = ::helpers::titlecase(_input); \
50 EXPECT_PRED_FORMAT2(::helpers::CompareCaseMapping, e, a); \
55 std::string uppercase(
unicode_t codepoint);
56 std::string uppercase(
const std::string& text);
58 std::string lowercase(
unicode_t codepoint);
59 std::string lowercase(
const std::string& text);
61 std::string titlecase(
unicode_t codepoint);
62 std::string titlecase(
const std::string& text);
64 struct CaseMappingEntry
74 std::string lowercase;
75 std::string uppercase;
76 std::string titlecase;
79 ::testing::AssertionResult CompareCodepoint(
80 const char* expressionExpected,
const char* expressionActual,
81 const CaseMappingEntry& entryExpected,
const CaseMappingEntry& entryActual);
83 ::testing::AssertionResult CompareCaseMapping(
84 const char* expressionExpected,
const char* expressionActual,
85 const CaseMappingEntry& entryExpected,
const CaseMappingEntry& entryActual);
uint32_t unicode_t
UTF-32 encoded code point.
Definition: utf8rewind.h:235
Base includes for helper methods.